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
description: >
Object.seal an AggregateError object
Object.seal AggregateError
info: |
If Type(O) is not Object, return O.
Let status be ? SetIntegrityLevel(O, sealed).

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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