Closed
Bug 651971
Opened 13 years ago
Closed 13 years ago
Is JSON prototype established correctly? (Do we care?)
Categories
(Tamarin Graveyard :: Library, defect, P3)
Tracking
(Not tracked)
RESOLVED
INVALID
Q3 11 - Serrano
People
(Reporter: pnkfelix, Assigned: pnkfelix)
References
Details
In Lars's AS3 implementation of JSON (Bug 584704), he left a note:
// FIXME: Spec requires that JSON's [[Prototype]] is
// Object.prototype; but is it? Investigate.
I'm relatively ignorant of ECMAscript at this level of detail. I'm not sure how I would observe the [[Prototype]] of JSON, or ensure that it is Object.prototype (if that is in fact what is entailed by the ECMA standard, or if instead Lars should be referring to Object's [[Prototype]] rather than Object.prototype. Are the two synonymous? Is ECMA not talking about Object's [[Prototype]] when it says "the standard built-in Object prototype object (15.2.4)"? I suppose it might not be.
Anyway I don't have time at the minute to resolve the question but I do want to and hope to today or tomorrow.
Assignee: nobody → fklockii
Flags: in-testsuite-
Flags: flashplayer-qrb+
Priority: -- → P3
Target Milestone: --- → Q3 11 - Serrano
Comment 1•13 years ago
|
||
The [[Prototype]] of the JSON object, if JSON is implemented as an AS3 class, is not going to be Object.prototype, but an object that is the "prototype" (sic!) property of the unnamed metaclass for the JSON object. In turn, the [[Prototype]] object of that object is going to be the initial value of Class.prototype. This is observable, consider this, which prints "fnord":
class C {}
Class.prototype.toString = "fnord";
print(C.toString);
That it is so is a fact of life for AS3, and this behavior is evident elsewhere too, for example, normally Date's [[Prototype]] property delegates to Object.prototype, but in AS3 it delegates to Class.prototype first.
I would close the present bug as "not a bug".
Assignee | ||
Comment 2•13 years ago
|
||
closing as "not a bug", or closest resolution detail string thereof.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•