diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-19 09:25:14 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-19 09:56:31 +0100 |
commit | 6313e1fe4c27755adde87e62db1c2f9fac534ae4 (patch) | |
tree | c57bb29f65e02fbfcc07895a8cc2903fff9300ba /src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js | |
parent | b5a49a260d03249c386f1b63c249089383dd81fa (diff) | |
parent | cac65e7a222b848a735a974b0aeb43209b0cfa18 (diff) |
Merge branch 'dev' into stable
This starts Qt 5.1 release cycle
Change-Id: I892bbc73c276842894a720f761ce31ad1b015672
Diffstat (limited to 'src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js')
-rw-r--r-- | src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js b/src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js index cdd0a2e..8a9103d 100644 --- a/src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js +++ b/src/3rdparty/v8/test/mjsunit/harmony/module-parsing.js @@ -116,6 +116,11 @@ x , y +var +x +, +y + export var v1 = 1 @@ -157,3 +162,29 @@ try {} catch (module) {} module v = 20 + + + +// Check that module declarations are rejected in eval or local scope. + +module M { export let x; } + +assertThrows("export x;", SyntaxError); // It's using eval, so should throw. +assertThrows("export let x;", SyntaxError); +assertThrows("import x from M;", SyntaxError); +assertThrows("module M {};", SyntaxError); + +assertThrows("{ export x; }", SyntaxError); +assertThrows("{ export let x; }", SyntaxError); +assertThrows("{ import x from M; }", SyntaxError); +assertThrows("{ module M {}; }", SyntaxError); + +assertThrows("function f() { export x; }", SyntaxError); +assertThrows("function f() { export let x; }", SyntaxError); +assertThrows("function f() { import x from M; }", SyntaxError); +assertThrows("function f() { module M {}; }", SyntaxError); + +assertThrows("function f() { { export x; } }", SyntaxError); +assertThrows("function f() { { export let x; } }", SyntaxError); +assertThrows("function f() { { import x from M; } }", SyntaxError); +assertThrows("function f() { { module M {}; } }", SyntaxError); |