summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/tagged-template/template-object-frozen-non-strict.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/tagged-template/template-object-frozen-non-strict.js')
-rw-r--r--js/src/tests/test262/language/expressions/tagged-template/template-object-frozen-non-strict.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/tagged-template/template-object-frozen-non-strict.js b/js/src/tests/test262/language/expressions/tagged-template/template-object-frozen-non-strict.js
new file mode 100644
index 0000000000..f742f8b75b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/tagged-template/template-object-frozen-non-strict.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2014 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 12.3.7
+description: Template objects are frozen (as demonstrated outside of strict mode)
+info: |
+ The first argument to a tagged template should be frozen and define a `raw`
+ property that is also frozen.
+flags: [noStrict]
+---*/
+
+var templateObject = null;
+var threwError = false;
+(function(parameter) {
+ templateObject = parameter;
+})``;
+
+assert(templateObject !== null);
+templateObject.test262Prop = true;
+
+assert.sameValue(
+ templateObject.test262Prop, undefined, 'The template object is frozen'
+);
+
+templateObject.raw.test262Prop = true;
+
+assert.sameValue(
+ templateObject.raw.test262Prop, undefined, 'The "raw" object is frozen'
+);
+assert(
+ templateObject.raw !== undefined , 'Template object defines a `raw` property'
+);
+
+reportCompare(0, 0);