Debian Codegraph @

js/src/tests/test262/harness/verifyProperty-desc-is-not-object.js

raw
1 // Copyright (C) 2017 Leo Balter. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 The desc argument should be an object or undefined
7 includes: [propertyHelper.js]
8 features: [Symbol]
9 ---*/
10 var sample = { foo: 42 };
11
12 assert.throws(Test262Error, () => {
13 verifyProperty(sample, "foo", 'configurable');
14 }, "string");
15
16 assert.throws(Test262Error, () => {
17 verifyProperty(sample, 'foo', true);
18 }, "boolean");
19
20 assert.throws(Test262Error, () => {
21 verifyProperty(sample, 'foo', 42);
22 }, "number");
23
24 assert.throws(Test262Error, () => {
25 verifyProperty(sample, 'foo', null);
26 }, "null");
27
28 assert.throws(Test262Error, () => {
29 verifyProperty(sample, 'foo', Symbol(1));
30 }, "symbol");
31
32 reportCompare(0, 0);