js/src/tests/js1_8_5/regress/regress-586482-4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_8_5/regress/regress-586482-4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,25 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/*
     1.6 + * Any copyright is dedicated to the Public Domain.
     1.7 + * http://creativecommons.org/licenses/publicdomain/
     1.8 + */
     1.9 +
    1.10 +var expect, actual;
    1.11 +
    1.12 +var obj = {
    1.13 +    f: function() {
    1.14 +        expect = this.g;
    1.15 +        actual = arguments.callee.caller;
    1.16 +        print("Ok");
    1.17 +    }
    1.18 +};
    1.19 +
    1.20 +var obj2 = { __proto__: obj, g: function() { this.f(); }};
    1.21 +
    1.22 +var obj3 = { __proto__: obj2, h: function() { this.g(); }};
    1.23 +
    1.24 +var obj4 = { __proto__: obj3 }
    1.25 +
    1.26 +obj4.h();
    1.27 +
    1.28 +reportCompare(expect, actual, "ok");

mercurial