2016-03-29 22:42:53 +02:00
|
|
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
|
|
esid: sec-module-namespace-exotic-objects-delete-p
|
|
|
|
description: >
|
|
|
|
[[Delete]] behavior for a key that does not describe an exported binding
|
|
|
|
info: |
|
|
|
|
[...]
|
2017-04-05 19:34:37 +02:00
|
|
|
2. If Type(P) is Symbol, then
|
|
|
|
a. Return ? OrdinaryDelete(O, P).
|
|
|
|
3. Let exports be O.[[Exports]].
|
|
|
|
4. If P is an element of exports, return false.
|
|
|
|
5. Return true.
|
2016-03-29 22:42:53 +02:00
|
|
|
flags: [module]
|
2016-12-28 19:57:46 +01:00
|
|
|
features: [Reflect, Symbol, Symbol.toStringTag]
|
2016-03-29 22:42:53 +02:00
|
|
|
---*/
|
|
|
|
|
|
|
|
import * as ns from './delete-non-exported.js';
|
|
|
|
var sym = Symbol('test262');
|
|
|
|
|
|
|
|
assert(delete ns.undef, 'delete: undef');
|
|
|
|
assert(Reflect.deleteProperty(ns, 'undef'), 'Reflect.deleteProperty: undef');
|
|
|
|
|
|
|
|
assert(delete ns.default, 'delete: default');
|
|
|
|
assert(
|
|
|
|
Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
|
|
|
|
);
|
|
|
|
|
2017-04-05 19:34:37 +02:00
|
|
|
assert.throws(TypeError, function() { delete ns[Symbol.toStringTag]; }, 'delete: Symbol.toStringTag');
|
|
|
|
assert.sameValue(
|
|
|
|
Reflect.deleteProperty(ns, Symbol.toStringTag), false,
|
2016-03-29 22:42:53 +02:00
|
|
|
'Reflect.deleteProperty: Symbol.toStringTag'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(delete ns[sym], 'delete: symbol');
|
|
|
|
assert(Reflect.deleteProperty(ns, sym), 'Reflect.deleteProperty: symbol');
|