Coverage: Object.seal instances of all built-in constructors, and other built-in values. Fixes gh-2845

This commit is contained in:
Rick Waldron 2020-10-05 14:29:56 -04:00
parent c0b18dfadf
commit 8a65608dc2
48 changed files with 223 additions and 43 deletions

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an AggregateError object Object.seal AggregateError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an ArrayBuffer object Object.seal ArrayBuffer
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an ArrowFunction object Object.seal ArrowFunction
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an AsyncArrowFunction object Object.seal AsyncArrowFunction
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an AsyncFunction object Object.seal AsyncFunction
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an AsyncGeneratorFunction object Object.seal AsyncGeneratorFunction
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a BigInt64Array object Object.seal BigInt64Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a BigUint64Array object Object.seal BigUint64Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

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 boolean literal
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(true);

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Boolean object Object.seal Boolean
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a DataView object Object.seal DataView
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Date object Object.seal Date
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Error object Object.seal Error
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an EvalError object Object.seal EvalError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a FinalizationRegistry object Object.seal FinalizationRegistry
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Float32Array object Object.seal Float32Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Float64Array object Object.seal Float64Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Function object Object.seal Function
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a GeneratorFunction object Object.seal GeneratorFunction
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

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

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Int16Array object Object.seal Int16Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Int32Array object Object.seal Int32Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Int8Array object Object.seal Int8Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Map object Object.seal Map
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

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

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

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Number object Object.seal Number
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Object object Object.seal Object
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Promise object Object.seal Promise
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Proxy object Object.seal Proxy
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a RangeError object Object.seal RangeError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a ReferenceError object Object.seal ReferenceError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a RegExp object Object.seal RegExp
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Set object Object.seal Set
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a SharedArrayBuffer object Object.seal SharedArrayBuffer
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a String object Object.seal String
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a Symbol object Object.seal Symbol
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a SyntaxError object Object.seal SyntaxError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a TypeError object Object.seal TypeError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Uint16Array object Object.seal Uint16Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Uint32Array object Object.seal Uint32Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Uint8Array object Object.seal Uint8Array
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an Uint8ClampedArray object Object.seal Uint8ClampedArray
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

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

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal an URIError object Object.seal URIError
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a WeakMap object Object.seal WeakMap
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a WeakRef object Object.seal WeakRef
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).

View File

@ -4,7 +4,7 @@
/*--- /*---
esid: sec-object.seal esid: sec-object.seal
description: > description: >
Object.seal a WeakSet object Object.seal WeakSet
info: | info: |
If Type(O) is not Object, return O. If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed). Let status be ? SetIntegrityLevel(O, sealed).