Bug 152537 - [ES6] Arrow function. Default arguments in arrow functions
Summary: [ES6] Arrow function. Default arguments in arrow functions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 140855
  Show dependency treegraph
 
Reported: 2015-12-23 13:33 PST by GSkachkov
Modified: 2016-01-22 10:47 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.04 KB, patch)
2016-01-21 11:53 PST, GSkachkov
no flags Details | Formatted Diff | Diff
Patch (3.73 KB, patch)
2016-01-21 12:09 PST, GSkachkov
no flags Details | Formatted Diff | Diff
Patch (4.70 KB, patch)
2016-01-22 02:26 PST, GSkachkov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description GSkachkov 2015-12-23 13:33:38 PST
arrow function should support default parameters in argument declaration
var arrow = (param1, param2 = "default-value") => {
  console.log(param2);
}
Comment 1 GSkachkov 2016-01-21 11:53:59 PST
Created attachment 269476 [details]
Patch

Fix comments
Comment 2 GSkachkov 2016-01-21 12:09:41 PST
Created attachment 269480 [details]
Patch

Add tests
Comment 3 Saam Barati 2016-01-21 15:45:54 PST
Comment on attachment 269480 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=269480&action=review

> LayoutTests/js/script-tests/arrowfunction-syntax.js:90
> +shouldBe("((x, y = 'default-value') => x + y)('input-value:')",'"input-value:default-value"');

you should add a test where you pass in:
- "undefined" for y
- anything that isn't undefined for y
Comment 4 GSkachkov 2016-01-22 02:26:44 PST
Created attachment 269564 [details]
Patch

Fix comments
Comment 5 WebKit Commit Bot 2016-01-22 10:47:49 PST
Comment on attachment 269564 [details]
Patch

Clearing flags on attachment: 269564

Committed r195461: <http://trac.webkit.org/changeset/195461>
Comment 6 WebKit Commit Bot 2016-01-22 10:47:52 PST
All reviewed patches have been landed.  Closing bug.