Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / js1_5 / extensions / regress-543839.js
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * Any copyright is dedicated to the Public Domain.
4  * http://creativecommons.org/licenses/publicdomain/
5  * Contributor: Igor Bukanov
6  */
7
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 543839;
10 var summary = 'js_GetMutableScope caller must lock the object';
11 var actual;
12 var expect = 1;
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 jit(true);
18
19 function test()
20 {
21     jit(true);
22     for (var i = 0; i != 100; ++i)
23         var tmp = { a: 1 };
24     return 1;
25 }
26
27 if (typeof evalcx == 'undefined')
28 {
29     print('Skipping. This test requires evalcx.');
30     actual = expect;
31 } else {
32     test();
33     test();
34     test();
35     actual = evalcx("test()", this);
36 }
37
38 reportCompare(expect, actual, summary);