Bug 258656 - Support default parameter values
Support default parameter values
Status: RESOLVED FIXED
Product: javascript
Classification: Unclassified
Component: Editor
8.2
PC Linux
: P3 with 1 vote (vote)
: 8.2
Assigned To: Petr Hejl
issues@javascript
ecma6
:
Depends on:
Blocks: 242387
  Show dependency treegraph
 
Reported: 2016-04-05 12:32 UTC by Petr Pisl
Modified: 2016-05-31 09:11 UTC (History)
2 users (show)

See Also:
Issue Type: TASK
:


Attachments
with yesterday's trunk (on Win x64) (28.02 KB, image/jpeg)
2016-05-31 01:56 UTC, peterkehl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2016-04-05 12:32:51 UTC
Ecma 6 script introduce default parameters values. 

https://developer.mozilla.org/cs/docs/Web/JavaScript/Reference/Functions/Default_parameters

Currently there are false hints "Expected semicolons ... ". For example:

function f (x, y = 7, z = 42) {
    return x + y + z;
}
console.log(f(10));


Also names of parameters can be used in default value expression:

function singularAutoPlural(singular, plural = singular+"s", 
                            rallyingCry = plural + " ATTACK!!!") {
  return [singular, plural, rallyingCry ]; 
}

Mark occurrences has to mark all occurrences of a parameter in such case.
Comment 1 Petr Hejl 2016-04-14 10:01:32 UTC
Hint is fixed.
Comment 2 Petr Hejl 2016-04-14 10:17:45 UTC
Fixed. Tests web-main 036571934479
Comment 3 peterkehl 2016-05-31 01:54:42 UTC
This doesn't always work. See below and attached screenshot in yesterday's trunk:

function openPreview( config={} ) {
}
Comment 4 peterkehl 2016-05-31 01:56:08 UTC
Created attachment 159921 [details]
with yesterday's trunk (on Win x64)
Comment 5 Petr Hejl 2016-05-31 09:11:51 UTC
The feature is not in trunk it is on branch and will be merged later.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo