IDL: sequence<float> conversion should throw TypeError when there are non-finite values |
||||
Issue descriptionWe manually check for finite values in some places (e.g. IIRFilterNode) but it should be done by the binding layer as the spec says[1]. [1] https://heycam.github.io/webidl/#es-float
,
Apr 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9 commit 0f01bbd2bd685d4987f04347e6403c3e2d13e0c9 Author: bashi <bashi@chromium.org> Date: Thu Apr 06 03:43:52 2017 bindings: Explicitly pass ValueType to toImplArray This makes toImplArray use correct NativeValueTraits<T>. BUG= 707632 Review-Url: https://codereview.chromium.org/2791133002 Cr-Commit-Position: refs/heads/master@{#462346} [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/LayoutTests/intersection-observer/observer-exceptions.html [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/LayoutTests/webaudio/IIRFilter/iirfilter-basic.html [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/Source/bindings/scripts/v8_types.py [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/Source/bindings/tests/results/core/LongSequenceOrEvent.cpp [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp [modify] https://crrev.com/0f01bbd2bd685d4987f04347e6403c3e2d13e0c9/third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
,
Apr 6 2017
,
Apr 6 2017
This works great and removes quite a few checks in WebAudio. However, is it possible to have more informative error messages? The old WebAudio code used to print out the index where the first non-finite float occurred and also the value (NaN or +/- Infinity). The value is kind of useful because Infinity means I probably messed up very near the error. NaN means I've probably propagated lots of other invalid operations to get to this point.
,
Apr 6 2017
,
Apr 6 2017
Hmm, it's a bit difficult with the current implementation. In toImplArray() we are using TraitsType::nativeValue() and we propagate the exception raised by nativeValue() if exists. If we want to include the index, we create another exception but we loose the original exception. We don't have a way to create a wrapped exception. +haraken@ and yukishiino@ for their inputs.
,
Apr 7 2017
This seems a common demand that someone (in multiple layers) sometimes wants to add more info into an existing exception. I'd like to know solutions, too. :) Random ideas off the top of my head, a) An exception object is an object. You can technically add arbitrary properties to represent more information. b) What other browsers (especially Firefox) are doing? c) We could set the index in an ExceptionState in a loop, and the ExceptionState automatically adds the index into the message when it's thrown. FYI, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error There are vendor-specific extensions. |
||||
►
Sign in to add a comment |
||||
Comment 1 by rtoy@chromium.org
, Apr 4 2017