diff --git a/test/language/expressions/tagged-template/call-expression-context-no-strict.js b/test/language/expressions/tagged-template/call-expression-context-no-strict.js new file mode 100644 index 0000000000..834ebc71b5 --- /dev/null +++ b/test/language/expressions/tagged-template/call-expression-context-no-strict.js @@ -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); diff --git a/test/language/expressions/tagged-template/call-expression-context.js b/test/language/expressions/tagged-template/call-expression-context-strict.js similarity index 89% rename from test/language/expressions/tagged-template/call-expression-context.js rename to test/language/expressions/tagged-template/call-expression-context-strict.js index e58ff26b73..1bdb6ec2b2 100644 --- a/test/language/expressions/tagged-template/call-expression-context.js +++ b/test/language/expressions/tagged-template/call-expression-context-strict.js @@ -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);