Closed
Bug 1004767
Opened 11 years ago
Closed 4 years ago
TypedObject argument parsing treats the same number differently based on its encoding
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
INVALID
People
(Reporter: Waldo, Unassigned)
Details
Given:
var ST = new TypedObject.StructType({ x: TypedObject.uint32 });
This doesn't throw:
var st = new ST(new ArrayBuffer(4), 0);
But this does ("TypeError: invalid arguments"):
var st = new ST(new ArrayBuffer(4), new Float64Array(1)[0]);
Numbers are numbers in JS. It's not permitted to expose any sort of distinction wrt the underlying representation of a single number. DoubleValue(0) and Int32Value(0) must be treated identically.
Comment 1•11 years ago
|
||
Yes, this is a known bug. I used isInt32() checks which is clearly wrong. I'm planning on rewriting those routines once the spec settles down as to the precise set of arguments to expect in the constructor.
Comment 2•11 years ago
|
||
Thanks for filing by the way.
Comment 3•4 years ago
|
||
No longer valid, typed object can't be created from JavaScript code anymore.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•