Bug 185943 - [JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value if dst is nullptr
Summary: [JSC] ArrayPatternNode::emitDirectBinding does not return assignment target v...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 187085
  Show dependency treegraph
 
Reported: 2018-05-24 06:09 PDT by gfablima
Modified: 2018-08-08 09:01 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.53 KB, patch)
2018-06-26 23:56 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (3.92 KB, patch)
2018-06-27 02:58 PDT, Yusuke Suzuki
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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