diff --git a/test/language/module-code/instn-iee-bndng-cls.js b/test/language/module-code/instn-iee-bndng-cls.js index 65044bdba3..ea1a4357c3 100644 --- a/test/language/module-code/instn-iee-bndng-cls.js +++ b/test/language/module-code/instn-iee-bndng-cls.js @@ -43,5 +43,11 @@ assert.throws(ReferenceError, function() { typeof B; }, 'binding is created but not initialized'); -import { B } from './instn-iee-bndng-cls_FIXTURE.js'; +import { B, results } from './instn-iee-bndng-cls_FIXTURE.js'; export class A {} + +assert.sameValue(results.length, 4); +assert.sameValue(results[0], 'ReferenceError'); +assert.sameValue(results[1], 'undefined'); +assert.sameValue(results[2], 'ReferenceError'); +assert.sameValue(results[3], 'undefined'); diff --git a/test/language/module-code/instn-iee-bndng-cls_FIXTURE.js b/test/language/module-code/instn-iee-bndng-cls_FIXTURE.js index c32dc3bd5b..984eed4181 100644 --- a/test/language/module-code/instn-iee-bndng-cls_FIXTURE.js +++ b/test/language/module-code/instn-iee-bndng-cls_FIXTURE.js @@ -5,14 +5,17 @@ export { A as B } from './instn-iee-bndng-cls.js'; // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ImportName: -assert.throws(ReferenceError, function() { +export const results = []; +try { A; -}); -assert.sameValue(typeof A, 'undefined'); +} catch (error) { + results.push(error.name, typeof A); +} // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ExportName: -assert.throws(ReferenceError, function() { +try { B; -}); -assert.sameValue(typeof B, 'undefined'); +} catch (error) { + results.push(error.name, typeof B); +} diff --git a/test/language/module-code/instn-iee-bndng-const.js b/test/language/module-code/instn-iee-bndng-const.js index d5f04558ce..d38b90d164 100644 --- a/test/language/module-code/instn-iee-bndng-const.js +++ b/test/language/module-code/instn-iee-bndng-const.js @@ -40,8 +40,14 @@ flags: [module] ---*/ assert.throws(ReferenceError, function() { - typeof y; + typeof B; }, 'binding is created but not initialized'); -import { y } from './instn-iee-bndng-const_FIXTURE.js'; -export const x = null; +import { B, results } from './instn-iee-bndng-const_FIXTURE.js'; +export const A = null; + +assert.sameValue(results.length, 4); +assert.sameValue(results[0], 'ReferenceError'); +assert.sameValue(results[1], 'undefined'); +assert.sameValue(results[2], 'ReferenceError'); +assert.sameValue(results[3], 'undefined'); diff --git a/test/language/module-code/instn-iee-bndng-const_FIXTURE.js b/test/language/module-code/instn-iee-bndng-const_FIXTURE.js index 1cb195a073..b30fb47832 100644 --- a/test/language/module-code/instn-iee-bndng-const_FIXTURE.js +++ b/test/language/module-code/instn-iee-bndng-const_FIXTURE.js @@ -1,18 +1,21 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -export { x as y } from './instn-iee-bndng-const.js'; +export { A as B } from './instn-iee-bndng-const.js'; // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ImportName: -assert.throws(ReferenceError, function() { - x; -}); -assert.sameValue(typeof x, 'undefined'); +export const results = []; +try { + A; +} catch (error) { + results.push(error.name, typeof A); +} // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ExportName: -assert.throws(ReferenceError, function() { - y; -}); -assert.sameValue(typeof y, 'undefined'); +try { + B; +} catch (error) { + results.push(error.name, typeof B); +} diff --git a/test/language/module-code/instn-iee-bndng-fun.js b/test/language/module-code/instn-iee-bndng-fun.js index e9d94da882..df7164a04c 100644 --- a/test/language/module-code/instn-iee-bndng-fun.js +++ b/test/language/module-code/instn-iee-bndng-fun.js @@ -40,16 +40,22 @@ flags: [module] ---*/ assert.sameValue( - f2(), + B(), 77, 'binding is initialized to function value prior to module evaluation' ); assert.throws(TypeError, function() { - f2 = null; + B = null; }, 'binding rejects assignment'); -assert.sameValue(f2(), 77, 'binding value is immutable'); +assert.sameValue(B(), 77, 'binding value is immutable'); -import { f2 } from './instn-iee-bndng-fun_FIXTURE.js'; -export function f() { return 77; } +import { B, results } from './instn-iee-bndng-fun_FIXTURE.js'; +export function A() { return 77; } + +assert.sameValue(results.length, 4); +assert.sameValue(results[0], 'ReferenceError'); +assert.sameValue(results[1], 'undefined'); +assert.sameValue(results[2], 'ReferenceError'); +assert.sameValue(results[3], 'undefined'); diff --git a/test/language/module-code/instn-iee-bndng-fun_FIXTURE.js b/test/language/module-code/instn-iee-bndng-fun_FIXTURE.js index fb941814ba..1407154222 100644 --- a/test/language/module-code/instn-iee-bndng-fun_FIXTURE.js +++ b/test/language/module-code/instn-iee-bndng-fun_FIXTURE.js @@ -1,18 +1,21 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -export { f as f2 } from './instn-iee-bndng-fun.js'; +export { A as B } from './instn-iee-bndng-fun.js'; // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ImportName: -assert.throws(ReferenceError, function() { - f; -}); -assert.sameValue(typeof f, 'undefined'); +export const results = []; +try { + A; +} catch (error) { + results.push(error.name, typeof A); +} // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ExportName: -assert.throws(ReferenceError, function() { - f2; -}); -assert.sameValue(typeof f2, 'undefined'); +try { + B; +} catch (error) { + results.push(error.name, typeof B); +} diff --git a/test/language/module-code/instn-iee-bndng-gen.js b/test/language/module-code/instn-iee-bndng-gen.js index 0df26bef7a..4d8098a772 100644 --- a/test/language/module-code/instn-iee-bndng-gen.js +++ b/test/language/module-code/instn-iee-bndng-gen.js @@ -42,16 +42,22 @@ features: [generators] ---*/ assert.sameValue( - g2().next().value, + B().next().value, 455, 'binding is initialized to function value prior to module evaluation' ); assert.throws(TypeError, function() { - g2 = null; + B = null; }); -assert.sameValue(g2().next().value, 455, 'binding value is immutable'); +assert.sameValue(B().next().value, 455, 'binding value is immutable'); -import { g2 } from './instn-iee-bndng-gen_FIXTURE.js'; -export function* g () { return 455; } +import { B, results } from './instn-iee-bndng-gen_FIXTURE.js'; +export function* A () { return 455; } + +assert.sameValue(results.length, 4); +assert.sameValue(results[0], 'ReferenceError'); +assert.sameValue(results[1], 'undefined'); +assert.sameValue(results[2], 'ReferenceError'); +assert.sameValue(results[3], 'undefined'); diff --git a/test/language/module-code/instn-iee-bndng-gen_FIXTURE.js b/test/language/module-code/instn-iee-bndng-gen_FIXTURE.js index 8e06c457dd..96e051801d 100644 --- a/test/language/module-code/instn-iee-bndng-gen_FIXTURE.js +++ b/test/language/module-code/instn-iee-bndng-gen_FIXTURE.js @@ -1,18 +1,21 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -export { g as g2 } from './instn-iee-bndng-gen.js'; +export { A as B } from './instn-iee-bndng-gen.js'; // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ImportName: -assert.throws(ReferenceError, function() { - g; -}); -assert.sameValue(typeof g, 'undefined'); +export const results = []; +try { + A; +} catch (error) { + results.push(error.name, typeof A); +} // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ExportName: -assert.throws(ReferenceError, function() { - g2; -}); -assert.sameValue(typeof g2, 'undefined'); +try { + B; +} catch (error) { + results.push(error.name, typeof B); +} diff --git a/test/language/module-code/instn-iee-bndng-let.js b/test/language/module-code/instn-iee-bndng-let.js index 38c5ab6435..88f5de2189 100644 --- a/test/language/module-code/instn-iee-bndng-let.js +++ b/test/language/module-code/instn-iee-bndng-let.js @@ -40,8 +40,14 @@ flags: [module] ---*/ assert.throws(ReferenceError, function() { - typeof y; + typeof B; }, 'binding is created but not initialized'); -import { y } from './instn-iee-bndng-let_FIXTURE.js'; -export let x; +import { B, results } from './instn-iee-bndng-let_FIXTURE.js'; +export let A; + +assert.sameValue(results.length, 4); +assert.sameValue(results[0], 'ReferenceError'); +assert.sameValue(results[1], 'undefined'); +assert.sameValue(results[2], 'ReferenceError'); +assert.sameValue(results[3], 'undefined'); diff --git a/test/language/module-code/instn-iee-bndng-let_FIXTURE.js b/test/language/module-code/instn-iee-bndng-let_FIXTURE.js index bfe3d7c510..a683d5809c 100644 --- a/test/language/module-code/instn-iee-bndng-let_FIXTURE.js +++ b/test/language/module-code/instn-iee-bndng-let_FIXTURE.js @@ -1,18 +1,21 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -export { x as y } from './instn-iee-bndng-let.js'; +export { A as B } from './instn-iee-bndng-let.js'; // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ImportName: -assert.throws(ReferenceError, function() { - x; -}); -assert.sameValue(typeof x, 'undefined'); +export const results = []; +try { + A; +} catch (error) { + results.push(error.name, typeof A); +} // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ExportName: -assert.throws(ReferenceError, function() { - y; -}); -assert.sameValue(typeof y, 'undefined'); +try { + B; +} catch (error) { + results.push(error.name, typeof B); +} diff --git a/test/language/module-code/instn-iee-bndng-var.js b/test/language/module-code/instn-iee-bndng-var.js index aa1b3020e2..9d601a2ea5 100644 --- a/test/language/module-code/instn-iee-bndng-var.js +++ b/test/language/module-code/instn-iee-bndng-var.js @@ -40,16 +40,23 @@ flags: [module] ---*/ assert.sameValue( - y, + B, undefined, 'binding is initialized to `undefined` prior to module evaulation' ); assert.throws(TypeError, function() { - y = null; + B = null; }, 'binding rejects assignment'); -assert.sameValue(y, undefined, 'binding value is immutable'); +assert.sameValue(B, undefined, 'binding value is immutable'); + +import { B, results } from './instn-iee-bndng-var_FIXTURE.js'; +export var A = 99; + +assert.sameValue(results.length, 4); +assert.sameValue(results[0], 'ReferenceError'); +assert.sameValue(results[1], 'undefined'); +assert.sameValue(results[2], 'ReferenceError'); +assert.sameValue(results[3], 'undefined'); -import { y } from './instn-iee-bndng-var_FIXTURE.js'; -export var x = 99; diff --git a/test/language/module-code/instn-iee-bndng-var_FIXTURE.js b/test/language/module-code/instn-iee-bndng-var_FIXTURE.js index 5cbe15a99f..a601f643c9 100644 --- a/test/language/module-code/instn-iee-bndng-var_FIXTURE.js +++ b/test/language/module-code/instn-iee-bndng-var_FIXTURE.js @@ -1,18 +1,21 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -export { x as y } from './instn-iee-bndng-var.js'; +export { A as B } from './instn-iee-bndng-var.js'; // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ImportName: -assert.throws(ReferenceError, function() { - x; -}); -assert.sameValue(typeof x, 'undefined'); +export const results = []; +try { + A; +} catch (error) { + results.push(error.name, typeof A); +} // Taken together, the following two assertions demonstrate that there is no // entry in the environment record for ExportName: -assert.throws(ReferenceError, function() { - y; -}); -assert.sameValue(typeof y, 'undefined'); +try { + B; +} catch (error) { + results.push(error.name, typeof B); +}