Merge pull request #1581 from WebReflection/master

GetTemplateObject with a unique template object
This commit is contained in:
Rick Waldron 2018-06-07 22:50:25 -04:00 committed by GitHub
commit 9388d6ad70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 3 deletions

View File

@ -8,11 +8,17 @@ info: |
defined by the GetTemplateObject abstract operation.
includes: [propertyHelper.js]
---*/
var templateObject;
var templateObject, sameObject;
(function(parameter) {
function sameSite() {
tag`${Math.random()}`;
}
function tag(parameter) {
templateObject = parameter;
})`${1}`;
}
tag`${1}`;
assert(Array.isArray(templateObject.raw), 'The template object is an array');
@ -38,3 +44,13 @@ verifyNotConfigurable(templateObject.raw, '0');
verifyNotEnumerable(templateObject.raw, 'length');
verifyNotWritable(templateObject.raw, 'length')
verifyNotConfigurable(templateObject.raw, 'length');
sameSite();
sameObject = templateObject;
sameSite();
assert(
templateObject === sameObject,
'Normative: Cache templates per site, rather than by contents'
// https://github.com/tc39/ecma262/pull/890
);