tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

verifyProperty-desc-is-not-object.js (766B)


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