archives

« Bugzilla Issues Index

#4005 — 24.2.2.1 DataView: Remove length integer validation and use ToLength ?


24.2.2.1 DataView (buffer [ , byteOffset [ , byteLength ] ] )

Steps 12.a-d

Maybe change to:
---
Let viewLength be ToLength(byteLength).
ReturnIfAbrupt(viewLength).
---

for consistency with 22.2.1.4 %TypedArray% ( buffer [ , byteOffset [ , length ] ] ) steps 14.a-b .


OTOH DataView performs in general more offset and length validation (cf. GetViewValue, SetViewValue, byteOffset parameter in 24.2.2.1 DataView ).


that would miss the length must be an integer test in step d


I meant replacing all four steps 12.a-d with ToLength, similar to 22.2.1.4 %TypedArray% steps 14.a-b.


yes, but the RangeError checks in 12.d are a legacy requirement

and it actually appears that 20.2.1.4 also requires that same error check.

or maybe it doesn't. I think what I'm observing when I test these in browsers are the WebIDL argument validation rules being applied. And, that when we moved the typed arrays in to the ES6 spec. we decided that we would not bring along all of those checks (where aren't normally performed by other ES built-ins)

Removing an exception isn't normally considered a breaking change, so maybe the length usage is ok. I


It looks like existing browsers are inconsistent enought here that we probably can safely change to ToLength

fixed in rev34 editor's draft


fixed in rev34