fixup! Catch expected strictmode error

This commit is contained in:
Mike Pennisi 2015-04-02 17:57:17 -04:00
parent 9ed6ca769d
commit 04cd2f43bb
3 changed files with 60 additions and 8 deletions

View File

@ -0,0 +1,31 @@
// Copyright (C) Copyright 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: >
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'
);

View File

@ -0,0 +1,29 @@
// Copyright (C) Copyright 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: >
The first argument to a tagged template should be frozen and define a `raw`
property that is also frozen.
flags: [onlyStrict]
---*/
var templateObject = null;
var threwError = false;
(function(parameter) {
templateObject = parameter;
})``;
assert(templateObject !== null);
assert.throws(TypeError, function() {
templateObject.test262Prop = true;
});
assert(
templateObject.raw !== undefined , 'Template object defines a `raw` property'
);
assert.throws(TypeError, function() {
templateObject.raw.test262Prop = true;
});

View File

@ -13,10 +13,6 @@ var templateObject;
templateObject = parameter;
})`${1}`;
templateObject.test262Prop = true;
assert.sameValue(
templateObject.test262Prop, undefined, 'The template object is frozen'
);
assert(Array.isArray(templateObject.raw), 'The template object is an array');
assert(templateObject.hasOwnProperty('raw'));
@ -24,10 +20,6 @@ verifyNotEnumerable(templateObject, 'raw');
verifyNotWritable(templateObject, 'raw')
verifyNotConfigurable(templateObject, 'raw');
templateObject.raw.test262Prop = true;
assert.sameValue(
templateObject.raw.test262Prop, undefined, 'The "raw" object is frozen'
);
assert(Array.isArray(templateObject), 'The "raw" object is an array');
verifyEnumerable(templateObject, '0');