tor-browser

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

builtin.js (985B)


      1 // Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-json.stringify
      5 description: >
      6  Tests that JSON.stringify meets the requirements
      7  for built-in objects defined by the introduction of chapter 17 of
      8  the ECMAScript Language Specification.
      9 features: [Reflect.construct]
     10 ---*/
     11 
     12 assert(Object.isExtensible(JSON.stringify), 'Object.isExtensible(JSON.stringify) must return true');
     13 assert.sameValue(
     14  Object.prototype.toString.call(JSON.stringify),
     15  '[object Function]',
     16  'Object.prototype.toString.call(JSON.stringify) must return "[object Function]"'
     17 );
     18 assert.sameValue(
     19  Object.getPrototypeOf(JSON.stringify),
     20  Function.prototype,
     21  'Object.getPrototypeOf(JSON.stringify) must return the value of Function.prototype'
     22 );
     23 assert.sameValue(
     24  JSON.stringify.hasOwnProperty('prototype'),
     25  false,
     26  'JSON.stringify.hasOwnProperty("prototype") must return false'
     27 );
     28 
     29 reportCompare(0, 0);