Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-354541-02.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-354541-02.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 354541;
9 var summary = 'Regression to standard class constructors in case labels';
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 + ': in function');
23
24 String.prototype.trim = function() { print('hallo'); };
25
26 const S = String;
27 const Sp = String.prototype;
28
29 expect = 'No Error';
30 actual = 'No Error';
31 if (typeof Script == 'undefined')
32 {
33 print('Test skipped. Script not defined.');
34 }
35 else
36 {
37 var s = Script('var tmp = function(o) { switch(o) { case String: case 1: return ""; } }; print(String === S); print(String.prototype === Sp); "".trim();');
38 s();
39 }
40
41 reportCompare(expect, actual, summary);
42
43 exitFunc ('test');
44 }