Rename imported to namespace

This commit is contained in:
Leo Balter 2018-10-09 18:05:39 -04:00
parent 1c119e323e
commit ec1d7ccc6f
8 changed files with 17 additions and 17 deletions

View File

@ -2,7 +2,7 @@
// Copyright (C) 2018 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/module-code/dynamic-import/module-namespace-object/await-
path: language/module-code/dynamic-import/ns/await-
name: value from await resolving
esid: sec-finishdynamicimport
info: |
@ -73,7 +73,7 @@ flags: [async]
---*/
async function fn() {
const imported = await /*{ import }*/;
const ns = await /*{ import }*/;
/*{ body }*/
}

View File

@ -2,7 +2,7 @@
// Copyright (C) 2018 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/module-code/dynamic-import/module-namespace-object/promise-then-
path: language/module-code/dynamic-import/ns/promise-then-
name: value from promise then
esid: sec-finishdynamicimport
info: |
@ -72,7 +72,7 @@ features: [dynamic-import]
flags: [async]
---*/
/*{ import }*/.then(imported => {
/*{ import }*/.then(ns => {
/*{ body }*/

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Module namespace objects have a Symbol.toStringTag
template: module-namespace-object
template: namespace
info: |
@@toStringTag
@ -16,13 +16,13 @@ features: [Symbol.toStringTag]
//- import
import('./module-code_FIXTURE.js')
//- body
assert.sameValue(imported[Symbol.toStringTag], 'Module');
assert.sameValue(ns[Symbol.toStringTag], 'Module');
// propertyHelper.js is not appropriate for this test because it assumes that
// the object exposes the ordinary object's implementation of [[Get]], [[Set]],
// [[Delete]], and [[OwnPropertyKeys]], which the module namespace exotic
// object does not.
var desc = Object.getOwnPropertyDescriptor(imported, Symbol.toStringTag);
var desc = Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag);
assert.sameValue(desc.enumerable, false, 'reports as non-enumerable');
assert.sameValue(desc.writable, false, 'reports as non-writable');

View File

@ -2,11 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Module namespace objects are not extensible.
template: module-namespace-object
template: namespace
includes: [propertyHelper.js]
---*/
//- import
import('./module-code_FIXTURE.js')
//- body
assert.sameValue(Object.isExtensible(imported), false);
assert.sameValue(Object.isExtensible(ns), false);

View File

@ -3,11 +3,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Module namespace objects lack a Symbol.toStringTag
template: module-namespace-object
template: namespace
features: [Symbol.iterator]
---*/
//- import
import('./module-code_FIXTURE.js')
//- body
assert.sameValue(Object.prototype.hasOwnProperty.call(imported, Symbol.iterator), false);
assert.sameValue(Object.prototype.hasOwnProperty.call(ns, Symbol.iterator), false);

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: imported object properties descriptors
template: module-namespace-object
template: namespace
---*/
//- import
@ -12,21 +12,21 @@ import('./module-code_FIXTURE.js')
// the object exposes the ordinary object's implementation of [[Get]], [[Set]],
// [[Delete]], and [[OwnPropertyKeys]], which the module namespace exotic
// object does not.
var desc = Object.getOwnPropertyDescriptor(imported, 'default');
var desc = Object.getOwnPropertyDescriptor(ns, 'default');
assert.sameValue(desc.value, 42, 'default value is 42');
assert.sameValue(desc.enumerable, true, 'default reports as enumerable');
assert.sameValue(desc.writable, true, 'default reports as writable');
assert.sameValue(desc.configurable, false, 'default reports as non-configurable');
desc = Object.getOwnPropertyDescriptor(imported, 'x');
desc = Object.getOwnPropertyDescriptor(ns, 'x');
assert.sameValue(desc.value, 'Test262', 'x value is "Test262"');
assert.sameValue(desc.enumerable, true, 'x reports as enumerable');
assert.sameValue(desc.writable, true, 'x reports as writable');
assert.sameValue(desc.configurable, false, 'x reports as non-configurable');
desc = Object.getOwnPropertyDescriptor(imported, 'z');
desc = Object.getOwnPropertyDescriptor(ns, 'z');
assert.sameValue(desc.value, 42, 'z value is 42');
assert.sameValue(desc.enumerable, true, 'z reports as enumerable');

View File

@ -2,10 +2,10 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Module namespace object prototype is null
template: module-namespace-object
template: namespace
---*/
//- import
import('./module-code_FIXTURE.js')
//- body
assert.sameValue(Object.getPrototypeOf(imported), null, 'prototype is null');
assert.sameValue(Object.getPrototypeOf(ns), null, 'prototype is null');