Bug 185943

Summary: [JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value if dst is nullptr
Product: WebKit Reporter: gfablima
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, isol2, mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 187085    
Attachments:
Description Flags
Patch
none
Patch mark.lam: review+

Description gfablima 2018-05-24 06:09:41 PDT
Hi everyone,
it was observed that javascriptcore have unexpected behaviour when I'm trying to return a destructuring list inside a function.

OS: Ubuntu 16.04 x64
Version: 606.1.9.4

Steps to reproduce:
function test (){
    return ( [a,b,] = [1, 2] );
}

print( [a,b,] = [1, 2] )
print( test() )

Actual Results:
- 1,2
- undefined

Expected Results:
- 1,2
- 1,2

Notes: V8, Chakra and SpiderMonkey works as expected.
Comment 1 Yusuke Suzuki 2018-06-26 23:56:17 PDT
Created attachment 343694 [details]
Patch
Comment 2 Yusuke Suzuki 2018-06-27 02:58:00 PDT
Created attachment 343706 [details]
Patch
Comment 3 Mark Lam 2018-06-27 03:04:20 PDT
Comment on attachment 343706 [details]
Patch

r=me
Comment 4 Yusuke Suzuki 2018-06-27 03:05:56 PDT
Committed r233252: <https://trac.webkit.org/changeset/233252>
Comment 5 Radar WebKit Bug Importer 2018-06-27 03:06:22 PDT
<rdar://problem/41515297>
Comment 6 isol2 2018-08-08 09:01:35 PDT
cinfuzz