mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Coverage: Object.seal instances of all built-in constructors. Fixes gh-2845
This commit is contained in:
parent
d6732b2e28
commit
9d345b6a85
36
test/built-ins/Object/seal/seal-aggregateerror-object.js
Normal file
36
test/built-ins/Object/seal/seal-aggregateerror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an AggregateError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new AggregateError([]));
|
36
test/built-ins/Object/seal/seal-arraybuffer-object.js
Normal file
36
test/built-ins/Object/seal/seal-arraybuffer-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an ArrayBuffer object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new ArrayBuffer());
|
36
test/built-ins/Object/seal/seal-arrowfunction-object.js
Normal file
36
test/built-ins/Object/seal/seal-arrowfunction-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an ArrowFunction object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new (Object.getPrototypeOf(() => {}).constructor)());
|
36
test/built-ins/Object/seal/seal-asyncarrowfunction-object.js
Normal file
36
test/built-ins/Object/seal/seal-asyncarrowfunction-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an AsyncArrowFunction object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new (Object.getPrototypeOf(async () => {}).constructor)());
|
36
test/built-ins/Object/seal/seal-asyncfunction-object.js
Normal file
36
test/built-ins/Object/seal/seal-asyncfunction-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an AsyncFunction object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new (Object.getPrototypeOf(async function() {}).constructor)());
|
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an AsyncGeneratorFunction object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new (Object.getPrototypeOf(async function * () {}).constructor)());
|
36
test/built-ins/Object/seal/seal-bigint64array-object.js
Normal file
36
test/built-ins/Object/seal/seal-bigint64array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a BigInt64Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new BigInt64Array());
|
36
test/built-ins/Object/seal/seal-biguint64array-object.js
Normal file
36
test/built-ins/Object/seal/seal-biguint64array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a BigUint64Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new BigUint64Array());
|
36
test/built-ins/Object/seal/seal-boolean-object.js
Normal file
36
test/built-ins/Object/seal/seal-boolean-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Boolean object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Boolean());
|
36
test/built-ins/Object/seal/seal-dataview-object.js
Normal file
36
test/built-ins/Object/seal/seal-dataview-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a DataView object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new DataView(new ArrayBuffer(4)));
|
36
test/built-ins/Object/seal/seal-date-object.js
Normal file
36
test/built-ins/Object/seal/seal-date-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Date object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Date());
|
36
test/built-ins/Object/seal/seal-error-object.js
Normal file
36
test/built-ins/Object/seal/seal-error-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Error object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Error());
|
36
test/built-ins/Object/seal/seal-evalerror-object.js
Normal file
36
test/built-ins/Object/seal/seal-evalerror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an EvalError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new EvalError());
|
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a FinalizationRegistry object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new FinalizationRegistry(() => {}));
|
36
test/built-ins/Object/seal/seal-float32array-object.js
Normal file
36
test/built-ins/Object/seal/seal-float32array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Float32Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Float32Array());
|
36
test/built-ins/Object/seal/seal-float64array-object.js
Normal file
36
test/built-ins/Object/seal/seal-float64array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Float64Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Float64Array());
|
36
test/built-ins/Object/seal/seal-function-object.js
Normal file
36
test/built-ins/Object/seal/seal-function-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Function object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Function());
|
36
test/built-ins/Object/seal/seal-generatorfunction-object.js
Normal file
36
test/built-ins/Object/seal/seal-generatorfunction-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a GeneratorFunction object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new (Object.getPrototypeOf(function * () {}).constructor)());
|
36
test/built-ins/Object/seal/seal-int16array-object.js
Normal file
36
test/built-ins/Object/seal/seal-int16array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Int16Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Int16Array());
|
36
test/built-ins/Object/seal/seal-int32array-object.js
Normal file
36
test/built-ins/Object/seal/seal-int32array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Int32Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Int32Array());
|
36
test/built-ins/Object/seal/seal-int8array-object.js
Normal file
36
test/built-ins/Object/seal/seal-int8array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Int8Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Int8Array());
|
36
test/built-ins/Object/seal/seal-map-object.js
Normal file
36
test/built-ins/Object/seal/seal-map-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Map object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Map());
|
36
test/built-ins/Object/seal/seal-number-object.js
Normal file
36
test/built-ins/Object/seal/seal-number-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Number object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Number(1));
|
36
test/built-ins/Object/seal/seal-object-object.js
Normal file
36
test/built-ins/Object/seal/seal-object-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Object object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Object());
|
36
test/built-ins/Object/seal/seal-promise-object.js
Normal file
36
test/built-ins/Object/seal/seal-promise-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Promise object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Promise(() => {}));
|
36
test/built-ins/Object/seal/seal-proxy-object.js
Normal file
36
test/built-ins/Object/seal/seal-proxy-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Proxy object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Proxy({}, {}));
|
36
test/built-ins/Object/seal/seal-rangeerror-object.js
Normal file
36
test/built-ins/Object/seal/seal-rangeerror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a RangeError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new RangeError());
|
36
test/built-ins/Object/seal/seal-referenceerror-object.js
Normal file
36
test/built-ins/Object/seal/seal-referenceerror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a ReferenceError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new ReferenceError());
|
36
test/built-ins/Object/seal/seal-regexp-object.js
Normal file
36
test/built-ins/Object/seal/seal-regexp-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a RegExp object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new RegExp(""));
|
36
test/built-ins/Object/seal/seal-set-object.js
Normal file
36
test/built-ins/Object/seal/seal-set-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Set object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Set());
|
36
test/built-ins/Object/seal/seal-sharedarraybuffer-object.js
Normal file
36
test/built-ins/Object/seal/seal-sharedarraybuffer-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a SharedArrayBuffer object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new SharedArrayBuffer(4));
|
36
test/built-ins/Object/seal/seal-string-object.js
Normal file
36
test/built-ins/Object/seal/seal-string-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a String object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new String(""));
|
36
test/built-ins/Object/seal/seal-symbol-object.js
Normal file
36
test/built-ins/Object/seal/seal-symbol-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a Symbol object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(Symbol());
|
36
test/built-ins/Object/seal/seal-syntaxerror-object.js
Normal file
36
test/built-ins/Object/seal/seal-syntaxerror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a SyntaxError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new SyntaxError());
|
36
test/built-ins/Object/seal/seal-typeerror-object.js
Normal file
36
test/built-ins/Object/seal/seal-typeerror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a TypeError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new TypeError());
|
36
test/built-ins/Object/seal/seal-uint16array-object.js
Normal file
36
test/built-ins/Object/seal/seal-uint16array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Uint16Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Uint16Array());
|
36
test/built-ins/Object/seal/seal-uint32array-object.js
Normal file
36
test/built-ins/Object/seal/seal-uint32array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Uint32Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Uint32Array());
|
36
test/built-ins/Object/seal/seal-uint8array-object.js
Normal file
36
test/built-ins/Object/seal/seal-uint8array-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Uint8Array object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Uint8Array());
|
36
test/built-ins/Object/seal/seal-uint8clampedarray-object.js
Normal file
36
test/built-ins/Object/seal/seal-uint8clampedarray-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an Uint8ClampedArray object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new Uint8ClampedArray());
|
36
test/built-ins/Object/seal/seal-urierror-object.js
Normal file
36
test/built-ins/Object/seal/seal-urierror-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal an URIError object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new URIError());
|
36
test/built-ins/Object/seal/seal-weakmap-object.js
Normal file
36
test/built-ins/Object/seal/seal-weakmap-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a WeakMap object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new WeakMap());
|
36
test/built-ins/Object/seal/seal-weakref-object.js
Normal file
36
test/built-ins/Object/seal/seal-weakref-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a WeakRef object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new WeakRef({}));
|
36
test/built-ins/Object/seal/seal-weakset-object.js
Normal file
36
test/built-ins/Object/seal/seal-weakset-object.js
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object.seal
|
||||
description: >
|
||||
Object.seal a WeakSet object
|
||||
info: |
|
||||
If Type(O) is not Object, return O.
|
||||
Let status be ? SetIntegrityLevel(O, sealed).
|
||||
|
||||
SetIntegrityLevel ( O, level )
|
||||
|
||||
Assert: Type(O) is Object.
|
||||
Assert: level is either sealed or frozen.
|
||||
Let status be ? O.[[PreventExtensions]]().
|
||||
If status is false, return false.
|
||||
Let keys be ? O.[[OwnPropertyKeys]]().
|
||||
If level is sealed, then
|
||||
For each element k of keys, do
|
||||
Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor { [[Configurable]]: false }).
|
||||
Else,
|
||||
Assert: level is frozen.
|
||||
For each element k of keys, do
|
||||
Let currentDesc be ? O.[[GetOwnProperty]](k).
|
||||
If currentDesc is not undefined, then
|
||||
If IsAccessorDescriptor(currentDesc) is true, then
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false }.
|
||||
Else,
|
||||
Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.
|
||||
Perform ? DefinePropertyOrThrow(O, k, desc).
|
||||
Return true.
|
||||
|
||||
---*/
|
||||
|
||||
Object.seal(new WeakSet());
|
Loading…
x
Reference in New Issue
Block a user