Coverage: Object.seal instances of all built-in constructors. Fixes gh-2845

This commit is contained in:
Rick Waldron 2020-10-05 13:45:37 -04:00
parent d6732b2e28
commit 9d345b6a85
43 changed files with 1548 additions and 0 deletions

View 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([]));

View 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());

View 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)());

View 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)());

View 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)());

View 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 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)());

View 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());

View 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());

View 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());

View 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)));

View 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());

View 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());

View 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());

View 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 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(() => {}));

View 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());

View 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());

View 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());

View 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)());

View 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());

View 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());

View 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());

View 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());

View 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));

View 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());

View 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(() => {}));

View 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({}, {}));

View 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());

View 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());

View 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(""));

View 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());

View 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));

View 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(""));

View 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());

View 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());

View 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());

View 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());

View 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());

View 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());

View 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());

View 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());

View 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());

View 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({}));

View 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());