summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js
new file mode 100644
index 000000000..a45f547f7
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A3.1.js
@@ -0,0 +1,24 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S11.1.1_A3.1;
+ * @section: 11.1.1;
+ * @assertion: Being in function code, "this" and eval("this"), called as a functions, return the global object;
+ * @description: Creating function which returns "this" or eval("this");
+ * @non_strict_only
+*/
+
+//CHECK#1
+function MyFunction() {return this}
+if (MyFunction() !== this) {
+ $ERROR('#1: function MyFunction() {return this} MyFunction() === this. Actual: ' + (MyFunction()));
+}
+
+//CHECK#2
+function MyFunction() {return eval("this")}
+if (MyFunction() !== this) {
+ $ERROR('#2: function MyFunction() {return eval("this")} MyFunction() === this. Actual: ' + (MyFunction()));
+}
+
+