diff --git a/test/harness/assert-false.js b/test/harness/assert-false.js new file mode 100644 index 0000000000000000000000000000000000000000..93b8205813669a2d7e3214c6ae788e2aacfc32d3 --- /dev/null +++ b/test/harness/assert-false.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + `false` does not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert(false); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-notsamevalue-nan.js b/test/harness/assert-notsamevalue-nan.js new file mode 100644 index 0000000000000000000000000000000000000000..856cc482c77eee8b8e0387cdd8fc8c0b786ced70 --- /dev/null +++ b/test/harness/assert-notsamevalue-nan.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Two references to NaN do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.notSameValue(NaN, NaN); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-notsamevalue-notsame.js b/test/harness/assert-notsamevalue-notsame.js new file mode 100644 index 0000000000000000000000000000000000000000..ae222b15d6293eb6b20cd5969ab1e6c9d8f570ca --- /dev/null +++ b/test/harness/assert-notsamevalue-notsame.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Values that are not strictly equal satisfy the assertion. +---*/ + +assert.notSameValue(undefined, null); +assert.notSameValue(null, undefined); +assert.notSameValue(0, 1); +assert.notSameValue(1, 0); +assert.notSameValue('', 's'); +assert.notSameValue('s', ''); diff --git a/test/harness/assert-notsamevalue-objects.js b/test/harness/assert-notsamevalue-objects.js new file mode 100644 index 0000000000000000000000000000000000000000..1e4fb54a998ab54ef151dde88b27056d25b7503b --- /dev/null +++ b/test/harness/assert-notsamevalue-objects.js @@ -0,0 +1,9 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Distinct objects satisfy the assertion. +---*/ + +assert.notSameValue({}, {}); diff --git a/test/harness/assert-notsamevalue-zeros.js b/test/harness/assert-notsamevalue-zeros.js new file mode 100644 index 0000000000000000000000000000000000000000..9a2d105429d1f9fad8e90518490e61fc3bfcc81e --- /dev/null +++ b/test/harness/assert-notsamevalue-zeros.js @@ -0,0 +1,9 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Positive and negative zero satisfy the assertion. +---*/ + +assert.notSameValue(0, -0); diff --git a/test/harness/assert-obj.js b/test/harness/assert-obj.js new file mode 100644 index 0000000000000000000000000000000000000000..edaf82fc694f45c8c867f585d38f0d431716d600 --- /dev/null +++ b/test/harness/assert-obj.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + An object literal does not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert({}); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-samevalue-nan.js b/test/harness/assert-samevalue-nan.js new file mode 100644 index 0000000000000000000000000000000000000000..8ca9e56e6ea3c8076125a4b2380fe5052da50a46 --- /dev/null +++ b/test/harness/assert-samevalue-nan.js @@ -0,0 +1,9 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Two references to NaN satisfy the assertion. +---*/ + +assert.sameValue(NaN, NaN); diff --git a/test/harness/assert-samevalue-objects.js b/test/harness/assert-samevalue-objects.js new file mode 100644 index 0000000000000000000000000000000000000000..833f864b4dca559c72e5b2e3a5ff230edfe0ddaf --- /dev/null +++ b/test/harness/assert-samevalue-objects.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Distinct objects do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.sameValue({}, {}); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-samevalue-same.js b/test/harness/assert-samevalue-same.js new file mode 100644 index 0000000000000000000000000000000000000000..0e38a9cef7b7b1bae31fd8548ecad6f64356ef05 --- /dev/null +++ b/test/harness/assert-samevalue-same.js @@ -0,0 +1,18 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Values that are strictly equal satisfy the assertion. +---*/ +var obj; + +assert.sameValue(undefined, undefined); +assert.sameValue(null, null); +assert.sameValue(0, 0); +assert.sameValue(1, 1); +assert.sameValue('', ''); +assert.sameValue('s', 's'); + +obj = {}; +assert.sameValue(obj, obj); diff --git a/test/harness/assert-samevalue-zeros.js b/test/harness/assert-samevalue-zeros.js new file mode 100644 index 0000000000000000000000000000000000000000..a4a44a031d47cf13655e03543799f7a79ca0fcfc --- /dev/null +++ b/test/harness/assert-samevalue-zeros.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Positive and negative zero do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.sameValue(0, -0); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-throws-custom.js b/test/harness/assert-throws-custom.js new file mode 100644 index 0000000000000000000000000000000000000000..4d42b130c3c77b21b83a44c4da3c98179c17424f --- /dev/null +++ b/test/harness/assert-throws-custom.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions that throw instances of the specified constructor function + satisfy the assertion. +---*/ + +function MyError() {} + +assert.throws(MyError, function() { + throw new MyError(); +}); diff --git a/test/harness/assert-throws-incorrect-ctor.js b/test/harness/assert-throws-incorrect-ctor.js new file mode 100644 index 0000000000000000000000000000000000000000..47f4f0ba76c9474cfca3b28861ed7d284ae1d5e6 --- /dev/null +++ b/test/harness/assert-throws-incorrect-ctor.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions that throw values whose constructor does not match the specified + constructor do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.throws(Error, function() { + throw new TypeError(); + }); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-throws-native.js b/test/harness/assert-throws-native.js new file mode 100644 index 0000000000000000000000000000000000000000..7650acb19e9adbc4e6216d4ccc638ed17ec9e4bc --- /dev/null +++ b/test/harness/assert-throws-native.js @@ -0,0 +1,36 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions that throw instances of the specified native Error constructor + satisfy the assertion. +---*/ + +assert.throws(Error, function() { + throw new Error(); +}); + +assert.throws(EvalError, function() { + throw new EvalError(); +}); + +assert.throws(RangeError, function() { + throw new RangeError(); +}); + +assert.throws(ReferenceError, function() { + throw new ReferenceError(); +}); + +assert.throws(SyntaxError, function() { + throw new SyntaxError(); +}); + +assert.throws(TypeError, function() { + throw new TypeError(); +}); + +assert.throws(URIError, function() { + throw new URIError(); +}); diff --git a/test/harness/assert-throws-no-arg.js b/test/harness/assert-throws-no-arg.js new file mode 100644 index 0000000000000000000000000000000000000000..c8a9f3510ba4e38ac47b93fd7a057c28bb73e26a --- /dev/null +++ b/test/harness/assert-throws-no-arg.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + The assertion fails when invoked without arguments. +---*/ + +var threw = false; + +try { + assert.throws(); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-throws-no-error.js b/test/harness/assert-throws-no-error.js new file mode 100644 index 0000000000000000000000000000000000000000..d40b06b44c2ab4446c3f4e1b0873691ef1e28e95 --- /dev/null +++ b/test/harness/assert-throws-no-error.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions that do not throw errors do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.throws(Error, function() {}); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-throws-null.js b/test/harness/assert-throws-null.js new file mode 100644 index 0000000000000000000000000000000000000000..7b10f612477a98c631f8febfcdcc606360f20d49 --- /dev/null +++ b/test/harness/assert-throws-null.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions that throw the `null` value do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.throws(Error, function() { + throw null; + }); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-throws-primitive.js b/test/harness/assert-throws-primitive.js new file mode 100644 index 0000000000000000000000000000000000000000..f1f86e18e0e5242746978f6395e22eba2a16691c --- /dev/null +++ b/test/harness/assert-throws-primitive.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions that throw primitive values do not satisfy the assertion. +---*/ + +var threw = false; + +try { + assert.throws(Error, function() { + throw 3; + }); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-throws-single-arg.js b/test/harness/assert-throws-single-arg.js new file mode 100644 index 0000000000000000000000000000000000000000..3606a1608dcb6d50962ffea299d34b1ca53175d2 --- /dev/null +++ b/test/harness/assert-throws-single-arg.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + The assertion fails when invoked with a single argument. +---*/ + +var threw = false; + +try { + assert.throws(function() {}); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/assert-true.js b/test/harness/assert-true.js new file mode 100644 index 0000000000000000000000000000000000000000..7050005a9c09743326f03484c0bc910538db4094 --- /dev/null +++ b/test/harness/assert-true.js @@ -0,0 +1,9 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + `true` satisfies the assertion. +---*/ + +assert(true); diff --git a/test/harness/compare-array-different-elements.js b/test/harness/compare-array-different-elements.js new file mode 100644 index 0000000000000000000000000000000000000000..32ed51c8197688f557fe6e16e41f1389c05f87c3 --- /dev/null +++ b/test/harness/compare-array-different-elements.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Arrays containing different elements are not equivalent. +includes: [compareArray.js] +---*/ + +var first = [0, 'a', undefined]; +var second = [0, 'b', undefined]; + +if (compareArray(first, second) !== false) { + $ERROR('Arrays containing different elements are not equivalent.'); +} diff --git a/test/harness/compare-array-different-length.js b/test/harness/compare-array-different-length.js new file mode 100644 index 0000000000000000000000000000000000000000..df48a86638c1e03b4668a3a8bf9c9bb5c110c9c6 --- /dev/null +++ b/test/harness/compare-array-different-length.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Arrays of differing lengths are not equivalent. +includes: [compareArray.js] +---*/ + +if (compareArray([], [undefined]) !== false) { + $ERROR('Arrays of differing lengths are not equivalent.'); +} + +if (compareArray([undefined], []) !== false) { + $ERROR('Arrays of differing lengths are not equivalent.'); +} diff --git a/test/harness/compare-array-empty.js b/test/harness/compare-array-empty.js new file mode 100644 index 0000000000000000000000000000000000000000..f3196db4c436e136c01201de850c9004cea72c40 --- /dev/null +++ b/test/harness/compare-array-empty.js @@ -0,0 +1,12 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Empty arrays of are equivalent. +includes: [compareArray.js] +---*/ + +if (compareArray([], []) !== true) { + $ERROR('Empty arrays are equivalent.'); +} diff --git a/test/harness/compare-array-same-elements-different-order.js b/test/harness/compare-array-same-elements-different-order.js new file mode 100644 index 0000000000000000000000000000000000000000..243d670baee6511f65e54edd78e06b434784b0ff --- /dev/null +++ b/test/harness/compare-array-same-elements-different-order.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Arrays containg the same elements in different order are not equivalent. +includes: [compareArray.js] +---*/ + +var obj = {}; +var first = [0, 1, '', 's', null, undefined, obj]; +var second = [0, 1, '', 's', undefined, null, obj]; + +if (compareArray(first, second) !== false) { + $ERROR('Arrays containing the same elements in different order are not equivalent.'); +} diff --git a/test/harness/compare-array-same-elements-same-order.js b/test/harness/compare-array-same-elements-same-order.js new file mode 100644 index 0000000000000000000000000000000000000000..ac09fed284aa26620eba4f0fe332862535592d04 --- /dev/null +++ b/test/harness/compare-array-same-elements-same-order.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Arrays containg the same elements in the same order are equivalent. +includes: [compareArray.js] +---*/ + +var obj = {}; +var first = [0, 1, '', 's', undefined, null, obj]; +var second = [0, 1, '', 's', undefined, null, obj]; + +if (compareArray(first, second) !== true) { + $ERROR('Arrays containing the same elements in the same order are equivalent.'); +} diff --git a/test/harness/compare-array-sparse.js b/test/harness/compare-array-sparse.js new file mode 100644 index 0000000000000000000000000000000000000000..316039a06f134abcd602abc5c14fce4555c533bd --- /dev/null +++ b/test/harness/compare-array-sparse.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Spares arrays are only equivalent if they have the same length. +includes: [compareArray.js] +---*/ + +if (compareArray([,], [,]) !== true) { + $ERROR('Sparse arrays of the same length are equivalent.'); +} + +if (compareArray([,], [,,]) !== false) { + $ERROR('Sparse arrays of differing lengths are not equivalent.'); +} + +if (compareArray([,,], [,]) !== false) { + $ERROR('Sparse arrays of differing lengths are not equivalent.'); +} + +if (compareArray([,], []) !== false) { + $ERROR('Sparse arrays are not equivalent to empty arrays.'); +} + +if (compareArray([], [,]) !== false) { + $ERROR('Sparse arrays are not equivalent to empty arrays.'); +} diff --git a/test/harness/error.js b/test/harness/error.js new file mode 100644 index 0000000000000000000000000000000000000000..e6cee574f61a19848581b712a87c5770eef15cf4 --- /dev/null +++ b/test/harness/error.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + The global `$ERROR` function throws an instance of the global `Test262` + function with the specified message. +---*/ + +var threw = false; + +try { + $ERROR('This is a test message'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + throw new Error( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } + if (err.message !== 'This is a test message') { + throw new Error('The error thrown did not define the specified message.'); + } +} + +if (threw === false) { + throw new Error('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifyconfigurable-configurable.js b/test/harness/propertyhelper-verifyconfigurable-configurable.js new file mode 100644 index 0000000000000000000000000000000000000000..997c9f93901a92f1db14230e10b3b89710084c6c --- /dev/null +++ b/test/harness/propertyhelper-verifyconfigurable-configurable.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is configurable satisfy the assertion. +includes: [propertyHelper.js] +---*/ + +var obj = {}; +Object.defineProperty(obj, 'a', { + configurable: true +}); + +verifyConfigurable(obj, 'a'); diff --git a/test/harness/propertyhelper-verifyconfigurable-not-configurable-not-strict.js b/test/harness/propertyhelper-verifyconfigurable-not-configurable-not-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..e8216b2329eb3fbc13b16983a4cfef69b6b9063a --- /dev/null +++ b/test/harness/propertyhelper-verifyconfigurable-not-configurable-not-strict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not configurable do not satisfy the + assertion outside of strict mode. +includes: [propertyHelper.js] +flags: [noStrict] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + configurable: false +}); + +try { + verifyConfigurable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifyconfigurable-not-configurable-strict.js b/test/harness/propertyhelper-verifyconfigurable-not-configurable-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..ce438f50fa65a4229dc3e8692ec144b7c70d4b2c --- /dev/null +++ b/test/harness/propertyhelper-verifyconfigurable-not-configurable-strict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not configurable do not satisfy the + assertion in strict mode. +includes: [propertyHelper.js] +flags: [onlyStrict] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + configurable: false +}); + +try { + verifyConfigurable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifyenumerable-enumerable.js b/test/harness/propertyhelper-verifyenumerable-enumerable.js new file mode 100644 index 0000000000000000000000000000000000000000..754099980232ea64513f570117837b73f79d4dd3 --- /dev/null +++ b/test/harness/propertyhelper-verifyenumerable-enumerable.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is enumerable satisfy the assertion. +includes: [propertyHelper.js] +---*/ + +var obj = {}; +Object.defineProperty(obj, 'a', { + enumerable: true +}); + +verifyEnumerable(obj, 'a'); diff --git a/test/harness/propertyhelper-verifyenumerable-not-enumerable.js b/test/harness/propertyhelper-verifyenumerable-not-enumerable.js new file mode 100644 index 0000000000000000000000000000000000000000..569ac0904a201da133a143e5cef17b6de1fd0dc5 --- /dev/null +++ b/test/harness/propertyhelper-verifyenumerable-not-enumerable.js @@ -0,0 +1,31 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not enumerable do not satisfy the + assertion. +includes: [propertyHelper.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + enumerable: false +}); + +try { + verifyEnumerable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifynotconfigurable-configurable.js b/test/harness/propertyhelper-verifynotconfigurable-configurable.js new file mode 100644 index 0000000000000000000000000000000000000000..4b66a9b12a9a7653a797f4e7bf02140f983e298b --- /dev/null +++ b/test/harness/propertyhelper-verifynotconfigurable-configurable.js @@ -0,0 +1,31 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is configurable do not satisfy the + assertion. +includes: [propertyHelper.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + configurable: true +}); + +try { + verifyNotConfigurable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifynotconfigurable-not-configurable-not-strict.js b/test/harness/propertyhelper-verifynotconfigurable-not-configurable-not-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..e8b882427a66f3ec46348aa7c9d04be6ac1f6f73 --- /dev/null +++ b/test/harness/propertyhelper-verifynotconfigurable-not-configurable-not-strict.js @@ -0,0 +1,17 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not configurable satisfy the assertion + outside of strict mode. +includes: [propertyHelper.js] +flags: [noStrict] +---*/ + +var obj = {}; +Object.defineProperty(obj, 'a', { + configurable: false +}); + +verifyNotConfigurable(obj, 'a'); diff --git a/test/harness/propertyhelper-verifynotconfigurable-not-configurable-strict.js b/test/harness/propertyhelper-verifynotconfigurable-not-configurable-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..b55107636577f51bbf663d479663b0c15e8fec8f --- /dev/null +++ b/test/harness/propertyhelper-verifynotconfigurable-not-configurable-strict.js @@ -0,0 +1,17 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not configurable satisfy the assertion + in strict mode. +includes: [propertyHelper.js] +flags: [onlyStrict] +---*/ + +var obj = {}; +Object.defineProperty(obj, 'a', { + configurable: false +}); + +verifyNotConfigurable(obj, 'a'); diff --git a/test/harness/propertyhelper-verifynotenumerable-enumerable.js b/test/harness/propertyhelper-verifynotenumerable-enumerable.js new file mode 100644 index 0000000000000000000000000000000000000000..1d838d4f6c3826067338f278276f1d8882e0cd53 --- /dev/null +++ b/test/harness/propertyhelper-verifynotenumerable-enumerable.js @@ -0,0 +1,31 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is enumerable do not satisfy the + assertion. +includes: [propertyHelper.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + enumerable: true +}); + +try { + verifyNotEnumerable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifynotenumerable-not-enumerable.js b/test/harness/propertyhelper-verifynotenumerable-not-enumerable.js new file mode 100644 index 0000000000000000000000000000000000000000..6e04b69309704c53dcb0712cce09be6f12e0149c --- /dev/null +++ b/test/harness/propertyhelper-verifynotenumerable-not-enumerable.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not enumerable satisfy the assertion. +includes: [propertyHelper.js] +---*/ + +var obj = {}; +Object.defineProperty(obj, 'a', { + enumerable: false +}); + +verifyNotEnumerable(obj, 'a'); diff --git a/test/harness/propertyhelper-verifynotwritable-not-writable-not-strict.js b/test/harness/propertyhelper-verifynotwritable-not-writable-not-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..7b2963ceb21a876d7e8e5c9c0deff20105bb56fd --- /dev/null +++ b/test/harness/propertyhelper-verifynotwritable-not-writable-not-strict.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not writable satisfy the assertion + outside of strict mode. +includes: [propertyHelper.js] +flags: [noStrict] +---*/ + +var obj = {}; + +Object.defineProperty(obj, 'a', { + writable: false, + value: 123 +}); + +verifyNotWritable(obj, 'a'); + +if (obj.a !== 123) { + $ERROR('`verifyNotWritable` should be non-destructive.'); +} diff --git a/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js b/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..f30533116fa663dc25d991e96da016df1edf3058 --- /dev/null +++ b/test/harness/propertyhelper-verifynotwritable-not-writable-strict.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not writable satisfy the assertion in + strict mode. +includes: [propertyHelper.js] +flags: [onlyStrict] +---*/ + +var obj = {}; + +Object.defineProperty(obj, 'a', { + writable: false, + value: 123 +}); + +verifyNotWritable(obj, 'a'); + +if (obj.a !== 123) { + $ERROR('`verifyNotWritable` should be non-destructive.'); +} diff --git a/test/harness/propertyhelper-verifynotwritable-writable.js b/test/harness/propertyhelper-verifynotwritable-writable.js new file mode 100644 index 0000000000000000000000000000000000000000..8eb1b75fb7ec4d4db27018c62c3a984b64466070 --- /dev/null +++ b/test/harness/propertyhelper-verifynotwritable-writable.js @@ -0,0 +1,31 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is writable do not satisfy the assertion. +includes: [propertyHelper.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: true, + value: 1 +}); + +try { + verifyNotWritable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifywritable-not-writable-not-strict.js b/test/harness/propertyhelper-verifywritable-not-writable-not-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..bae8fec16d652d3de61ab2d9cb85d964fed7694b --- /dev/null +++ b/test/harness/propertyhelper-verifywritable-not-writable-not-strict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not writable do not satisfy the + assertion outside of strict mode. +includes: [propertyHelper.js] +flags: [noStrict] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: false +}); + +try { + verifyWritable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifywritable-not-writable-strict.js b/test/harness/propertyhelper-verifywritable-not-writable-strict.js new file mode 100644 index 0000000000000000000000000000000000000000..1ee497f782aac98fb82530330e3ccc0dd841fa33 --- /dev/null +++ b/test/harness/propertyhelper-verifywritable-not-writable-strict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is not writable do not satisfy the + assertion in strict mode. +includes: [propertyHelper.js] +flags: [onlyStrict] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: false +}); + +try { + verifyWritable(obj, 'a'); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/propertyhelper-verifywritable-writable.js b/test/harness/propertyhelper-verifywritable-writable.js new file mode 100644 index 0000000000000000000000000000000000000000..5dc13e8c04725a5391aca41ed5ae6d01424c8a4e --- /dev/null +++ b/test/harness/propertyhelper-verifywritable-writable.js @@ -0,0 +1,21 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects whose specified property is writable satisfy the assertion. +includes: [propertyHelper.js] +---*/ + +var obj = {}; + +Object.defineProperty(obj, 'a', { + writable: true, + value: 123 +}); + +verifyWritable(obj, 'a'); + +if (obj.a !== 123) { + $ERROR('`verifyWritable` should be non-destructive.'); +} diff --git a/test/harness/testbuiltinobject-function-badstring.js b/test/harness/testbuiltinobject-function-badstring.js new file mode 100644 index 0000000000000000000000000000000000000000..5b7a4cba6c50a397673ef7bbcb486fd9d2eb5247 --- /dev/null +++ b/test/harness/testbuiltinobject-function-badstring.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that are expected to be functions but do not define the correct + [[Class]] internal property do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; + +try { + testBuiltInObject(null, true); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-function-expected-length.js b/test/harness/testbuiltinobject-function-expected-length.js new file mode 100644 index 0000000000000000000000000000000000000000..cc69d94ddfa50cddb89397b3699c6b61546129d9 --- /dev/null +++ b/test/harness/testbuiltinobject-function-expected-length.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Functions whose `length` property does not match the expected value do not + satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; + +try { + testBuiltInObject(function(a, b) {}, true, false, [], 3); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-function-not-constructor-no-error.js b/test/harness/testbuiltinobject-function-not-constructor-no-error.js new file mode 100644 index 0000000000000000000000000000000000000000..e3b9f73e347cdac5f7aa7fcc25269b661726bef1 --- /dev/null +++ b/test/harness/testbuiltinobject-function-not-constructor-no-error.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Non-constructor functions that do not throw an when invoked via `new` do + not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; + +try { + testBuiltInObject(function() {}, true, false, [], 0); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-function-not-constructor-no-typeerror.js b/test/harness/testbuiltinobject-function-not-constructor-no-typeerror.js new file mode 100644 index 0000000000000000000000000000000000000000..4a72bf34f25f486ad17f91610654919dc2a7c312 --- /dev/null +++ b/test/harness/testbuiltinobject-function-not-constructor-no-typeerror.js @@ -0,0 +1,30 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Non-constructor functions that do not throw a TypeError when invoked via + `new` do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; +var fn = function() { + throw new Error(); +}; + +try { + testBuiltInObject(fn, true, false, [], 0); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-non-extensible.js b/test/harness/testbuiltinobject-non-extensible.js new file mode 100644 index 0000000000000000000000000000000000000000..5d43f711d6a1cde1f6d72318e6445ce48805eba2 --- /dev/null +++ b/test/harness/testbuiltinobject-non-extensible.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that are not extensible do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; +var obj = {}; +Object.preventExtensions(obj); + +try { + testBuiltInObject(obj); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-not-function-badstring.js b/test/harness/testbuiltinobject-not-function-badstring.js new file mode 100644 index 0000000000000000000000000000000000000000..9d0e69c95e0359bd551a826ed2473377e01fa3f9 --- /dev/null +++ b/test/harness/testbuiltinobject-not-function-badstring.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that are not expected to be functions but do not define the correct + [[Class]] internal property do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; + +try { + testBuiltInObject(function() {}, false); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-prop-enumerable.js b/test/harness/testbuiltinobject-prop-enumerable.js new file mode 100644 index 0000000000000000000000000000000000000000..fda5a1abd1b1ff1f61c8adee8c5591b52527e2bc --- /dev/null +++ b/test/harness/testbuiltinobject-prop-enumerable.js @@ -0,0 +1,37 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that do not define all of the specified "own" properties as + non-enumerable do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: true, enumerable: false, configurable: true +}); +Object.defineProperty(obj, 'b', { + writable: true, enumerable: true, configurable: true +}); +Object.defineProperty(obj, 'c', { + writable: true, enumerable: false, configurable: true +}); + +try { + testBuiltInObject(obj, false, false, ['a', 'b', 'c']); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-prop-missing.js b/test/harness/testbuiltinobject-prop-missing.js new file mode 100644 index 0000000000000000000000000000000000000000..bfad8336e51a335ca2cdcd96e83d6e5f716fb5a9 --- /dev/null +++ b/test/harness/testbuiltinobject-prop-missing.js @@ -0,0 +1,34 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that do not define all of the specified "own" properties do not + satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: true, enumerable: false, configurable: true +}); +Object.defineProperty(obj, 'c', { + writable: true, enumerable: false, configurable: true +}); + +try { + testBuiltInObject(obj, false, false, ['a', 'b', 'c']); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-prop-not-configurable.js b/test/harness/testbuiltinobject-prop-not-configurable.js new file mode 100644 index 0000000000000000000000000000000000000000..661e3446751687634b0556ba5d806315c1390937 --- /dev/null +++ b/test/harness/testbuiltinobject-prop-not-configurable.js @@ -0,0 +1,37 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that do not define all of the specified "own" properties as + configurable do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: true, enumerable: false, configurable: true +}); +Object.defineProperty(obj, 'b', { + writable: true, enumerable: false, configurable: false +}); +Object.defineProperty(obj, 'c', { + writable: true, enumerable: false, configurable: true +}); + +try { + testBuiltInObject(obj, false, false, ['a', 'b', 'c']); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-prop-not-writable.js b/test/harness/testbuiltinobject-prop-not-writable.js new file mode 100644 index 0000000000000000000000000000000000000000..7f2ba95daa3e034c17e3672b26346f8fab112244 --- /dev/null +++ b/test/harness/testbuiltinobject-prop-not-writable.js @@ -0,0 +1,37 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Objects that do not define all of the specified "own" properties as + writable do not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; +var obj = {}; +Object.defineProperty(obj, 'a', { + writable: true, enumerable: false, configurable: true +}); +Object.defineProperty(obj, 'b', { + writable: false, enumerable: false, configurable: true +}); +Object.defineProperty(obj, 'c', { + writable: true, enumerable: false, configurable: true +}); + +try { + testBuiltInObject(obj, false, false, ['a', 'b', 'c']); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +} diff --git a/test/harness/testbuiltinobject-undefined.js b/test/harness/testbuiltinobject-undefined.js new file mode 100644 index 0000000000000000000000000000000000000000..ffab8c7ed1f6825008567486f25451d0e316ed67 --- /dev/null +++ b/test/harness/testbuiltinobject-undefined.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + `undefined` does not satisfy the assertion. +includes: [testBuiltInObject.js] +---*/ + +var threw = false; + +try { + testBuiltInObject(undefined); +} catch(err) { + threw = true; + if (err.constructor !== Test262Error) { + $ERROR( + 'Expected a Test262Error, but a "' + err.constructor.name + + '" was thrown.' + ); + } +} + +if (threw === false) { + $ERROR('Expected a Test262Error, but no error was thrown.'); +}