js/src/jit-test/tests/debug/makeGlobalObjectReference-02.js

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 // Debugger.prototype.makeGlobalObjectReference only accepts actual global objects.
     3 load(libdir + 'asserts.js');
     5 var dbg = new Debugger;
     7 assertThrowsInstanceOf(() => dbg.makeGlobalObjectReference(true), TypeError);
     8 assertThrowsInstanceOf(() => dbg.makeGlobalObjectReference("foo"), TypeError);
     9 assertThrowsInstanceOf(() => dbg.makeGlobalObjectReference(12), TypeError);
    10 assertThrowsInstanceOf(() => dbg.makeGlobalObjectReference(undefined), TypeError);
    11 assertThrowsInstanceOf(() => dbg.makeGlobalObjectReference(null), TypeError);
    12 assertThrowsInstanceOf(() => dbg.makeGlobalObjectReference({ xlerb: "sbot" }), TypeError);
    13 assertEq(dbg.makeGlobalObjectReference(this) instanceof Debugger.Object, true);

mercurial