mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
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:
parent
ef7ddf9f7e
commit
e42f977122
@ -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);
|
@ -8,14 +8,15 @@ info: >
|
|||||||
derived from a TemplateLiteral. The actual arguments include a template
|
derived from a TemplateLiteral. The actual arguments include a template
|
||||||
object and the values produced by evaluating the expressions embedded
|
object and the values produced by evaluating the expressions embedded
|
||||||
within the TemplateLiteral.
|
within the TemplateLiteral.
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
var context;
|
var context = null;
|
||||||
var fn = function() {
|
var fn = function() {
|
||||||
return function() {
|
return function() {
|
||||||
context = this;
|
context = this;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
fn`NoSubstitutionTemplate`;
|
fn()`NoSubstitutionTemplate`;
|
||||||
|
|
||||||
assert.sameValue(context, undefined);
|
assert.sameValue(context, undefined);
|
Loading…
x
Reference in New Issue
Block a user