mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Pushing new test I forgot to hg add (636364 ; thanks to philor for reminder).
This commit is contained in:
parent
24207017a6
commit
152621c128
29
js/src/tests/js1_8_5/regress/regress-636364.js
Normal file
29
js/src/tests/js1_8_5/regress/regress-636364.js
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
* Contributors: Jason Orendorff, Brendan Eich
|
||||
*/
|
||||
|
||||
if (typeof newGlobal == 'function') {
|
||||
var gsame = newGlobal('same-compartment');
|
||||
|
||||
gsame.eval("function f() { return this; }");
|
||||
f = gsame.f;
|
||||
assertEq(f(), this);
|
||||
|
||||
gsame.eval("function g() { 'use strict'; return this; }");
|
||||
g = gsame.g;
|
||||
assertEq(g(), undefined);
|
||||
|
||||
var gnew = newGlobal('new-compartment');
|
||||
|
||||
gnew.eval("function f() { return this; }");
|
||||
f = gnew.f;
|
||||
assertEq(f(), this);
|
||||
|
||||
gnew.eval("function g() { 'use strict'; return this; }");
|
||||
g = gnew.g;
|
||||
assertEq(g(), undefined);
|
||||
}
|
||||
|
||||
reportCompare(0, 0, "ok");
|
Loading…
Reference in New Issue
Block a user