| 1 |
// |reftest| module |
| 2 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 3 |
// This code is governed by the BSD license found in the LICENSE file. |
| 4 |
/*--- |
| 5 |
esid: sec-module-namespace-exotic-objects-getownproperty-p |
| 6 |
description: > |
| 7 |
Behavior of the [[GetOwnProperty]] internal method with a string argument |
| 8 |
describing a binding that cannot be found |
| 9 |
info: | |
| 10 |
1. If Type(P) is Symbol, return OrdinaryGetOwnProperty(O, P). |
| 11 |
2. Let exports be the value of O's [[Exports]] internal slot. |
| 12 |
3. If P is not an element of exports, return undefined. |
| 13 |
flags: [module] |
| 14 |
---*/ |
| 15 |
|
| 16 |
import * as ns from './get-own-property-str-not-found.js'; |
| 17 |
var test262; |
| 18 |
export { test262 as anotherName }; |
| 19 |
var desc; |
| 20 |
|
| 21 |
assert.sameValue( |
| 22 |
Object.prototype.hasOwnProperty.call(ns, 'test262'), |
| 23 |
false, |
| 24 |
'hasOwnProperty: test262' |
| 25 |
); |
| 26 |
desc = Object.getOwnPropertyDescriptor(ns, 'test262'); |
| 27 |
assert.sameValue(desc, undefined, 'property descriptor for "test262"'); |
| 28 |
|
| 29 |
assert.sameValue( |
| 30 |
Object.prototype.hasOwnProperty.call(ns, 'desc'), |
| 31 |
false, |
| 32 |
'hasOwnProperty: desc' |
| 33 |
); |
| 34 |
desc = Object.getOwnPropertyDescriptor(ns, 'desc'); |
| 35 |
assert.sameValue(desc, undefined, 'property descriptor for "desc"'); |
| 36 |
|
| 37 |
assert.sameValue( |
| 38 |
Object.prototype.hasOwnProperty.call(ns, 'toStringTag'), |
| 39 |
false, |
| 40 |
'hasOwnProperty: toStringTag' |
| 41 |
); |
| 42 |
desc = Object.getOwnPropertyDescriptor(ns, 'toStringTag'); |
| 43 |
assert.sameValue(desc, undefined, 'property descriptor for "toStringTag"'); |
| 44 |
|
| 45 |
assert.sameValue( |
| 46 |
Object.prototype.hasOwnProperty.call(ns, 'iterator'), |
| 47 |
false, |
| 48 |
'hasOwnProperty: iterator' |
| 49 |
); |
| 50 |
desc = Object.getOwnPropertyDescriptor(ns, 'iterator'); |
| 51 |
assert.sameValue(desc, undefined, 'property descriptor for "iterator"'); |
| 52 |
|
| 53 |
assert.sameValue( |
| 54 |
Object.prototype.hasOwnProperty.call(ns, '__proto__'), |
| 55 |
false, |
| 56 |
'hasOwnProperty: __proto__' |
| 57 |
); |
| 58 |
desc = Object.getOwnPropertyDescriptor(ns, '__proto__'); |
| 59 |
assert.sameValue(desc, undefined, 'property descriptor for "__proto__"'); |
| 60 |
|
| 61 |
assert.sameValue( |
| 62 |
Object.prototype.hasOwnProperty.call(ns, 'default'), |
| 63 |
false, |
| 64 |
'hasOwnProperty: default' |
| 65 |
); |
| 66 |
desc = Object.getOwnPropertyDescriptor(ns, 'default'); |
| 67 |
assert.sameValue(desc, undefined, 'property descriptor for "default"'); |
| 68 |
|
| 69 |
reportCompare(0, 0); |