mirror of https://github.com/tc39/test262.git
fixup! Catch expected strictmode error
This commit is contained in:
parent
9ed6ca769d
commit
04cd2f43bb
|
@ -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'
|
||||||
|
);
|
|
@ -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;
|
||||||
|
});
|
|
@ -13,10 +13,6 @@ var templateObject;
|
||||||
templateObject = parameter;
|
templateObject = parameter;
|
||||||
})`${1}`;
|
})`${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(Array.isArray(templateObject.raw), 'The template object is an array');
|
||||||
|
|
||||||
assert(templateObject.hasOwnProperty('raw'));
|
assert(templateObject.hasOwnProperty('raw'));
|
||||||
|
@ -24,10 +20,6 @@ verifyNotEnumerable(templateObject, 'raw');
|
||||||
verifyNotWritable(templateObject, 'raw')
|
verifyNotWritable(templateObject, 'raw')
|
||||||
verifyNotConfigurable(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');
|
assert(Array.isArray(templateObject), 'The "raw" object is an array');
|
||||||
|
|
||||||
verifyEnumerable(templateObject, '0');
|
verifyEnumerable(templateObject, '0');
|
||||||
|
|
Loading…
Reference in New Issue