| Index: sdk/lib/_internal/js_runtime/lib/preambles/d8.js
|
| diff --git a/sdk/lib/_internal/js_runtime/lib/preambles/d8.js b/sdk/lib/_internal/js_runtime/lib/preambles/d8.js
|
| index 75c0c459003976edd60f515b01f5719fc2d4ab09..ca9093756e46bee93a6cdc15d041a9c7a6811376 100644
|
| --- a/sdk/lib/_internal/js_runtime/lib/preambles/d8.js
|
| +++ b/sdk/lib/_internal/js_runtime/lib/preambles/d8.js
|
| @@ -16,21 +16,13 @@ if (typeof global != "undefined") self = global; // Node.js.
|
|
|
| // Location (Uri.base)
|
|
|
| - var workingDirectory;
|
| - // TODO(sgjesse): This does not work on Windows.
|
| - if (typeof os == "object" && "system" in os) {
|
| - // V8.
|
| - workingDirectory = os.system("pwd");
|
| - var length = workingDirectory.length;
|
| - if (workingDirectory[length - 1] == '\n') {
|
| - workingDirectory = workingDirectory.substring(0, length - 1);
|
| - }
|
| - } else if (typeof process != "undefined" &&
|
| + var baseUri = 'org-dartlang-d8-preamble:///mock/uri/base/';
|
| + if (typeof process != "undefined" &&
|
| typeof process.cwd == "function") {
|
| // Node.js.
|
| - workingDirectory = process.cwd();
|
| + baseUri = 'file://' + process.cwd() + '/';
|
| }
|
| - self.location = { href: "file://" + workingDirectory + "/" };
|
| + self.location = { href: baseUri };
|
|
|
| // Event loop.
|
|
|
|
|