tor-browser

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

15.2.3.6-4-414.js (1495B)


      1 // Copyright (c) 2012 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 es5id: 15.2.3.6-4-414
      6 description: >
      7    ES5 Attributes - Inherited property whose [[Enumerable]] attribute
      8    is set to true is enumerable (Object.create)
      9 ---*/
     10 
     11 var appointment = new Object();
     12 
     13 Object.defineProperty(appointment, "startTime", {
     14  value: 1001,
     15  writable: true,
     16  enumerable: true,
     17  configurable: true
     18 });
     19 Object.defineProperty(appointment, "name", {
     20  value: "NAME",
     21  writable: true,
     22  enumerable: true,
     23  configurable: true
     24 });
     25 
     26 var meeting = Object.create(appointment);
     27 Object.defineProperty(meeting, "conferenceCall", {
     28  value: "In-person meeting",
     29  writable: true,
     30  enumerable: true,
     31  configurable: true
     32 });
     33 
     34 var teamMeeting = Object.create(meeting);
     35 
     36 var verifyTimeProp = false;
     37 var verifyNameProp = false;
     38 var verifyCallProp = false;
     39 for (var p in teamMeeting) {
     40  if (p === "startTime") {
     41    verifyTimeProp = true;
     42  }
     43  if (p === "name") {
     44    verifyNameProp = true;
     45  }
     46  if (p === "conferenceCall") {
     47    verifyCallProp = true;
     48  }
     49 }
     50 
     51 var hasOwnProperty = !teamMeeting.hasOwnProperty("name") &&
     52  !teamMeeting.hasOwnProperty("startTime") &&
     53  !teamMeeting.hasOwnProperty("conferenceCall");
     54 
     55 assert(hasOwnProperty, 'hasOwnProperty !== true');
     56 assert(verifyTimeProp, 'verifyTimeProp !== true');
     57 assert(verifyNameProp, 'verifyNameProp !== true');
     58 assert(verifyCallProp, 'verifyCallProp !== true');
     59 
     60 reportCompare(0, 0);