This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge chakra-core/ChakraCore@911cfcb915] [MERGE #3538 @sigatrev] OS:…
…10898061 fix bug with cached scopes and default/destrctured arguments Merge pull request #3538 from sigatrev:CachedScopeChecks When cached scopes are used with default function arguments or destructured parameters, any variable references in the values of the default argument or destructured params would erroneously see the merged body and param scope
- Loading branch information
Showing
5 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
function foo( a = b ) | ||
{ | ||
eval(""); | ||
var b; | ||
} | ||
|
||
function bar( {a:a = b} ) | ||
{ | ||
eval(""); | ||
var b; | ||
} | ||
|
||
|
||
function test() | ||
{ | ||
try | ||
{ | ||
// foo should throw a ReferenceError: 'b' is not defined. | ||
foo(); | ||
return false; | ||
} | ||
catch( a ) | ||
{} | ||
|
||
try | ||
{ | ||
// bar should throw a ReferenceError: 'b' is not defined. | ||
bar({}); | ||
return false; | ||
} | ||
catch( a ) | ||
{} | ||
|
||
return true; | ||
} | ||
|
||
WScript.Echo(test() ? "PASSED" : "FAILED"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters