forked from denoland/deno
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent circular imports in ts code (denoland#576)
- Loading branch information
1 parent
3bcf7e2
commit 84c38f3
Showing
12 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ Cargo.lock | |
yarn.lock | ||
# npm deps | ||
node_modules | ||
.idea | ||
|
||
# RLS generated files | ||
/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2018 the Deno authors. All rights reserved. MIT license. | ||
// Public deno module. | ||
export { exit, readFileSync, writeFileSync } from "./os"; | ||
export { libdeno } from "./globals"; | ||
export { libdeno } from "./libdeno"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// If you use the eval function indirectly, by invoking it via a reference | ||
// other than eval, as of ECMAScript 5 it works in the global scope rather than | ||
// the local scope. This means, for instance, that function declarations create | ||
// global functions, and that the code being evaluated doesn't have access to | ||
// local variables within the scope where it's being called. | ||
export const globalEval = eval; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { RawSourceMap } from "./types"; | ||
import { globalEval } from "./global-eval"; | ||
|
||
// The libdeno functions are moved so that users can't access them. | ||
type MessageCallback = (msg: Uint8Array) => void; | ||
interface Libdeno { | ||
recv(cb: MessageCallback): void; | ||
|
||
send(msg: ArrayBufferView): null | Uint8Array; | ||
|
||
print(x: string): void; | ||
|
||
mainSource: string; | ||
mainSourceMap: RawSourceMap; | ||
} | ||
|
||
const window = globalEval("this"); | ||
export const libdeno = window.libdeno as Libdeno; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,5 +63,8 @@ | |
"allow-leading-underscore", | ||
"allow-trailing-underscore" | ||
] | ||
} | ||
}, | ||
"extends": [ | ||
"tslint-no-circular-imports" | ||
] | ||
} |