Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-300079.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-300079.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 300079;
9 var summary = "precompiled functions should inherit from current window's Function.prototype";
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 if (typeof clone == 'undefined') {
25 expect = 'SKIPPED';
26 actual = 'SKIPPED';
27 }
28 else {
29 expect = 'PASSED';
30
31 f = eval("(function (a) {return (function () { return a * a;}); })()");
32 g = clone(f, {a: 3});
33 f = null;
34 gc();
35 try {
36 a_squared = g(2);
37 if (a_squared != 9)
38 throw "Unexpected return from g: a_squared == " + a_squared;
39 actual = "PASSED";
40 } catch (e) {
41 actual = "FAILED: " + e;
42 }
43 }
44
45 reportCompare(expect, actual, summary);
46
47 exitFunc ('test');
48 }