Fix 'combo breaker' in CreateDynamicFunction to handle template literals.
BUG=chromium:663410 Review-Url: https://codereview.chromium.org/2533463002 Cr-Commit-Position: refs/heads/master@{#41320}
This commit is contained in:
parent
54aac1f778
commit
e0d608a2b1
@ -61,7 +61,7 @@ MaybeHandle<Object> CreateDynamicFunction(Isolate* isolate,
|
||||
// If the formal parameters include an unbalanced block comment, the
|
||||
// function must be rejected. Since JavaScript does not allow nested
|
||||
// comments we can include a trailing block comment to catch this.
|
||||
builder.AppendCString("\n/**/");
|
||||
builder.AppendCString("\n/*``*/");
|
||||
}
|
||||
builder.AppendCString(") {\n");
|
||||
if (argc > 0) {
|
||||
|
8
test/mjsunit/regress-crbug-663410.js
Normal file
8
test/mjsunit/regress-crbug-663410.js
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
function alert(x) {};
|
||||
assertThrows(
|
||||
Function("a=`","`,xss=1){alert(xss)")
|
||||
);
|
Loading…
Reference in New Issue
Block a user