Closed Bug 561646 Opened 14 years ago Closed 14 years ago

get Operator fails if the (optional) name of the function is specified.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
major

Tracking

()

VERIFIED WONTFIX

People

(Reporter: alice0775, Unassigned)

Details

(Keywords: dev-doc-complete, regression)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100425 Minefield/3.7a5pre ID:20100425040736
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100425 Minefield/3.7a5pre ID:20100425040736

get Operator fails if the (optional) name of the function  is specified.
See https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/get_Operator

The following code does not work on latest m-c nightly build.

var testtest = {
  get Value testtest_getValue() {
    return 1;
  }
};
testtest.Value;

Reproducible: Always

Steps to Reproduce:
1. Start Minefield with "NEW profile".
2. Open Error console.
3. Evaluete the following code in the Error console.
   var testtest = { get Value testtest_getValue() { return 1; } }; testtest.Value;

Actual Results:
 The following error shows in the Error console. And execution is fails.

Error: missing ( before formal parameters
Source file: javascript:%20var%20testtest%20=%20{%20get%20Value%20testtest_getValue()%20{%20return%201;%20}%20};%20testtest.Value;
Line: 1, Column: 28
Source code:
 var testtest = { get Value testtest_getValue() { return 1; } }; testtest.Value;
 
Expected Results:
 No error.
 Should return result of "1".

regression window:

works:
http://hg.mozilla.org/mozilla-central/rev/61c2144b66df
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100424 Minefield/3.7a5pre ID:20100424140450


fails:
http://hg.mozilla.org/mozilla-central/rev/759a2a19f8d3
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a5pre) Gecko/20100424 Minefield/3.7a5pre ID:20100424152002


pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=61c2144b66df&tochange=759a2a19f8d3
It also fails with disabling of javascript.options.jit.chrome  and  javascript.options.jit.content both .
Due to checked in Bug 560018  - { get property funname() { } } not actually prohibited, likely due to a mis-rebase through parser changes.
This is an extension (unintended, originally -- not that it matters) to ECMA-262 Edition 3, no longer supported.

If you want to set a name for the function to use in its toString (and toSource, another extension) result, although probably not as the value of its name property (yet another extension we still support), please file a separate bug asking for a "displayName" property (see http://trac.webkit.org/changeset/42478).

Thanks, and sorry for the inconvenience.

/be
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Adding dev-doc-needed (I couldn't get MDC to let me log in now, or I'd just have updated the page by my lonesome).
Keywords: dev-doc-needed
Bug 517580 has dev-doc-needed already.

/be
You need to log in before you can comment on or make changes to this bug.