fixup! Introduce additional tests for ES6 templates

Ensure test files assert the described behavior. Extend coverage to
strict and non-strict mode explicitly.
This commit is contained in:
Mike Pennisi 2015-06-16 15:10:09 -04:00
parent ef7ddf9f7e
commit e42f977122
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,22 @@
// Copyright (C) Copyright 2015 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: Invocation context for call expressions
info: >
A tagged template is a function call where the arguments of the call are
derived from a TemplateLiteral. The actual arguments include a template
object and the values produced by evaluating the expressions embedded
within the TemplateLiteral.
flags: [noStrict]
---*/
var context = null;
var fn = function() {
return function() {
context = this;
};
};
fn()`NoSubstitutionTemplate`;
assert.sameValue(context, this);

View File

@ -8,14 +8,15 @@ info: >
derived from a TemplateLiteral. The actual arguments include a template
object and the values produced by evaluating the expressions embedded
within the TemplateLiteral.
flags: [onlyStrict]
---*/
var context;
var context = null;
var fn = function() {
return function() {
context = this;
};
};
fn`NoSubstitutionTemplate`;
fn()`NoSubstitutionTemplate`;
assert.sameValue(context, undefined);