archives

« Bugzilla Issues Index

#4536 — 24.2.1.2 SetViewValue: Missing call to ToNumber


24.2.1.2 SetViewValue ( view, requestIndex, isLittleEndian, type, value )

SetViewValue calls SetValueInBuffer without converting the `value` argument to a number. This is invalid because SetValueInBuffer only accepts a numeric `value` argument.


Change SetViewValue, step 15 to:
---
15. Let numValue be ToNumber(value).
16. ReturnIfAbrupt(numValue).
17. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
18. Return SetValueInBuffer(buffer, bufferIndex, type, numValue, isLittleEndian).
---


Fixed in ES2016 Draft (4f875fe).