summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/expressions/tagged-template-constant-folding.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/expressions/tagged-template-constant-folding.js')
-rw-r--r--js/src/tests/non262/expressions/tagged-template-constant-folding.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/non262/expressions/tagged-template-constant-folding.js b/js/src/tests/non262/expressions/tagged-template-constant-folding.js
new file mode 100644
index 0000000000..6041cbc161
--- /dev/null
+++ b/js/src/tests/non262/expressions/tagged-template-constant-folding.js
@@ -0,0 +1,28 @@
+// Any copyright is dedicated to the Public Domain.
+// http://creativecommons.org/licenses/publicdomain/
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 1182373;
+var summary =
+ "Don't let constant-folding in the MemberExpression part of a tagged " +
+ "template cause an incorrect |this| be passed to the callee";
+
+print(BUGNUMBER + ": " + summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var prop = "global";
+
+var obj = { prop: "obj", f: function() { return this.prop; } };
+
+assertEq(obj.f``, "obj");
+assertEq((true ? obj.f : null)``, "global");
+
+/******************************************************************************/
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);
+
+print("Tests complete");