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)

x86
Windows XP
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: inonit, Assigned: norrisboyd)

References

Details

Attachments

(1 file, 4 obsolete files)

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.
Depends on: 368520
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 ...
Status: NEW → ASSIGNED
Assignee: nobody → inonit
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Attached patch Added my name to contributors (obsolete) — Splinter Review
I keep forgetting to add myself to the source files.
Attachment #254858 - Attachment is obsolete: true
(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.
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
Attached patch Added deprecatedSplinter Review
I keep forgetting details...
Attachment #254965 - Attachment is obsolete: true
Assignee: inonit → norrisboyd
Status: ASSIGNED → NEW
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
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.

Attachment

General

Creator:
Created:
Updated:
Size: