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 constructors, return the object michael@0: * michael@0: * @path ch11/11.1/11.1.1/S11.1.1_A3.2.js michael@0: * @description Create function. It have property, that returned "this" michael@0: * @noStrict michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: function MyFunction() {this.THIS = this} michael@0: if ((new MyFunction()).THIS.toString() !== "[object Object]") { michael@0: $ERROR('#1: function MyFunction() {this.THIS = this} (new MyFunction()).THIS.toString() !== "[object Object]". Actual: ' + ((new MyFunction()).THIS.toString())); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: function MyFunction() {this.THIS = eval("this")} michael@0: if ((new MyFunction()).THIS.toString() !== "[object Object]") { michael@0: $ERROR('#2: function MyFunction() {this.THIS = eval("this")} (new MyFunction()).THIS.toString() !== "[object Object]". Actual: ' + ((new MyFunction()).THIS.toString())); michael@0: } michael@0: michael@0: