michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Being in function code, "this" and eval("this"), called as a functions, return the global object michael@0: * michael@0: * @path ch11/11.1/11.1.1/S11.1.1_A3.1.js michael@0: * @description Creating function which returns "this" or eval("this") michael@0: * @noStrict michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: function MyFunction() {return this} michael@0: if (MyFunction() !== this) { michael@0: $ERROR('#1: function MyFunction() {return this} MyFunction() === this. Actual: ' + (MyFunction())); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: function MyFunction() {return eval("this")} michael@0: if (MyFunction() !== this) { michael@0: $ERROR('#2: function MyFunction() {return eval("this")} MyFunction() === this. Actual: ' + (MyFunction())); michael@0: } michael@0: michael@0: michael@0: