Skip to content

Commit 96c3c33

Browse files
committedOct 26, 2018
[MERGE #5799 @wyrichte] Fails AsmJs.cpp's module return check if a property definition in the return object literal is not a binary parse node.
Merge pull request #5799 from wyrichte:build/wyrichte/asm_async
2 parents 276661f + a24ede7 commit 96c3c33

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed
 

‎lib/Runtime/Language/AsmJs.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,11 @@ namespace Js
851851

852852
if( member )
853853
{
854+
if (!(member->Grfnop() & fnopBin))
855+
{
856+
return m.Fail(node, _u("Return object member must be an assignment expression"));
857+
}
858+
854859
ParseNode* field = ParserWrapper::GetBinaryLeft( member );
855860
ParseNode* value = ParserWrapper::GetBinaryRight( member );
856861
if( !ParserWrapper::IsNameDeclaration( field ) || !ParserWrapper::IsNameDeclaration( value ) )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Return object member must be an assignment expression
2+
Asm.js compilation failed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//-------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft Corporation and contributors. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
//-------------------------------------------------------------------------------------------------------
5+
6+
function f() {
7+
"use asm";
8+
return { ...a, b };
9+
}

‎test/AsmJs/rlexe.xml

+7
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,13 @@
987987
<compile-flags>-forcedeferparse -testtrace:asmjs</compile-flags>
988988
</default>
989989
</test>
990+
<test>
991+
<default>
992+
<files>notBinaryPropertyDefinition.js</files>
993+
<baseline>notBinaryPropertyDefinition.baseline</baseline>
994+
<compile-flags>-ES2018ObjectRestSpread -testtrace:asmjs</compile-flags>
995+
</default>
996+
</test>
990997
<test>
991998
<default>
992999
<files>constbrbug.js</files>

0 commit comments

Comments
 (0)
Please sign in to comment.