Closed
Bug 368455
Opened 18 years ago
Closed 18 years ago
Implement "get" and "set" getter/setter forms in object initializers in Rhino
Categories
(Rhino Graveyard :: Core, enhancement)
Tracking
(Not tracked)
RESOLVED
FIXED
1.6R6
People
(Reporter: inonit, Assigned: norrisboyd)
References
Details
Attachments
(1 file, 4 obsolete files)
16.29 KB,
patch
|
Details | Diff | Splinter Review |
SpiderMonkey allows the definition of getter and setter functions in an object initializer. See, e.g., http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Creating_New_Objects:Defining_Getters_and_Setters
Rhino would gain compatibility by adding this feature as well. On the other hand, it would require modifying Rhino's parser, which has been described recently (and not-so-recently) as a frightening proposition.
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
Apologize for not getting to this yet. It's in the queue and I want to be careful with it, given that the last patch I committed (bug 224334) turned out to have some issues ...
Reporter | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Updated•18 years ago
|
Assignee: nobody → inonit
Status: ASSIGNED → NEW
Reporter | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Comment 3•18 years ago
|
||
Attachment #254086 -
Attachment is obsolete: true
Comment 4•18 years ago
|
||
I keep forgetting to add myself to the source files.
Attachment #254858 -
Attachment is obsolete: true
Comment 5•18 years ago
|
||
(In reply to comment #3)
> Created an attachment (id=254858) [details]
> Revised patch with compile path supported and a decompiler bug fixed.
>
Almost good - you must keep the ScriptRuntime.newObjectLiteral() method with the old signature as well for backward compatibility. Developers can compile scripts to .class files offline with "jsc" command line utility, and we strive to preserve binary compatibility of the ScriptRuntime's public API, so scripts compiled to .class files with earlier Rhino continue working with a later version. Of course, you can have the old signature version delegate to new signature version, and you can mark the old signature version deprecated.
Comment 6•18 years ago
|
||
Added a backward compatible version of NativeFunction.newObjectLiteral based on a comment from Attila that got attached to bug 369525,
Attachment #254870 -
Attachment is obsolete: true
Comment 7•18 years ago
|
||
I keep forgetting details...
Attachment #254965 -
Attachment is obsolete: true
Assignee | ||
Updated•18 years ago
|
Assignee: inonit → norrisboyd
Status: ASSIGNED → NEW
Assignee | ||
Comment 8•18 years ago
|
||
Fixed in cvs:
Checking in Decompiler.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Decompiler.java,v <-- Decompiler.java
new revision: 1.22; previous revision: 1.21
done
Checking in Interpreter.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java,v <-- Interpreter.java
new revision: 1.319; previous revision: 1.318
done
Checking in Parser.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Parser.java,v <-- Parser.java
new revision: 1.109; previous revision: 1.108
done
Checking in ScriptRuntime.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java,v <-- ScriptRuntime.java
new revision: 1.258; previous revision: 1.257
done
Checking in Token.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Token.java,v <-- Token.java
new revision: 1.37; previous revision: 1.36
done
Checking in optimizer/Codegen.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java,v <-- Codegen.java
new revision: 1.244; previous revision: 1.243
done
Only change from Bob's patch was to remove the @Deprecated annotation since
we haven't been requiring JDK 1.5 to compile.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•18 years ago
|
||
Adding target milestone of 1.6R6 based on the date this bug was resolved FIXED.
Target Milestone: --- → 1.6R6
You need to log in
before you can comment on or make changes to this bug.
Description
•