Chromium Code Reviews| Index: frog/frog.dart |
| diff --git a/frog/frog.dart b/frog/frog.dart |
| index 5fe2e679b2d95cd54ce9ca9d9f4f3cb987de0240..415948fd020c8aa54e3cb01d72665780df2bd6e5 100644 |
| --- a/frog/frog.dart |
| +++ b/frog/frog.dart |
| @@ -9,10 +9,16 @@ |
| void main() { |
| // Get the home directory from our executable. |
| var homedir = path.dirname(fs.realpathSync(process.argv[1])); |
| - if (compile(homedir, process.argv, new NodeFileSystem())) { |
| + |
| + // Note: we create a copy of argv here because the one that is passed in is |
| + // potentially a JS Array object from outside the sandbox. Hence it will have |
| + // the wrong prototype. |
| + var argv = new List.from(process.argv); |
|
jimhug
2011/11/07 16:41:26
TODO: This seems like a bug in the node interop th
Jennifer Messerly
2011/11/07 22:13:10
It's a bug in our createSandbox. We pass certain o
|
| + |
| + if (compile(homedir, argv, new NodeFileSystem())) { |
| var code = world.getGeneratedCode(); |
| if (!options.compileOnly) { |
| - process.argv = [process.argv[0], process.argv[1]]; |
| + process.argv = [argv[0], argv[1]]; |
| process.argv.addAll(options.childArgs); |
| vm.runInNewContext(code, createSandbox()); |
| } |