mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Module sources should be parsed in strict mode (#2920)
Co-authored-by: Marko Fabo <mfabo@inf.u-szeged.hu> JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
parent
03202995a0
commit
cbd41df5eb
@ -700,7 +700,7 @@ ecma_module_parse (ecma_module_t *module_p) /**< module */
|
||||
0,
|
||||
(jerry_char_t *) source_p,
|
||||
source_size,
|
||||
JERRY_PARSE_NO_OPTS,
|
||||
JERRY_PARSE_STRICT_MODE,
|
||||
&bytecode_data_p);
|
||||
|
||||
JERRY_CONTEXT (module_top_context_p) = module_p->context_p->parent_p;
|
||||
|
||||
@ -13,4 +13,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var y, z;
|
||||
export default x = y = z = "default";
|
||||
|
||||
@ -29,5 +29,5 @@ assert (Array.isArray(mod.d))
|
||||
assert (x === 42)
|
||||
assert (mod.f("str") === "str")
|
||||
|
||||
dog = new mod.Dog("Oddie")
|
||||
var dog = new mod.Dog("Oddie")
|
||||
assert (dog.speak() === "Oddie barks.")
|
||||
|
||||
@ -14,3 +14,6 @@
|
||||
*/
|
||||
|
||||
import "tests/jerry/es2015/module-import-01.js"
|
||||
import "tests/jerry/es2015/module-export-05.js"
|
||||
import "tests/jerry/es2015/module-export-06.js"
|
||||
import "tests/jerry/es2015/module-export-07.js"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user