js/src/tests/js1_8_5/regress/regress-598176.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /*
     3  * Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/licenses/publicdomain/
     5  */
     7 function make() {
     8   var r = {};
     9   r.desc = {get: function() {}};
    10   r.a = Object.defineProperty({}, "prop", r.desc);
    11   r.info = Object.getOwnPropertyDescriptor(r.a, "prop");
    12   return r;
    13 }
    15 r1 = make();
    16 assertEq(r1.desc.get, r1.info.get);
    18 // Distinct evaluations of an object literal make distinct methods.
    19 r2 = make();
    20 assertEq(r1.desc.get === r2.desc.get, false);
    22 r1.info.get.foo = 42;
    24 assertEq(r1.desc.get.hasOwnProperty('foo'), !r2.desc.get.hasOwnProperty('foo'));
    25 assertEq(r1.info.get.hasOwnProperty('foo'), !r2.info.get.hasOwnProperty('foo'));
    27 reportCompare(0, 0, "ok");

mercurial