Bug 1552911 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

In my debug build, we abort on the first line here, because `value` (of type `ResizeObserverSize*`) is null:
```c++
template <class T, GetOrCreateReflectorWrapBehavior wrapBehavior>
MOZ_ALWAYS_INLINE bool DoGetOrCreateDOMReflector(
    JSContext* cx, T* value, JS::Handle<JSObject*> givenProto,
    JS::MutableHandle<JS::Value> rval) {
  MOZ_ASSERT(value);
```
...because we're trying to read the `borderBoxSize` from a default-constructed `ResizeObserverEntry` object, and it's null.

(I assume that actual resizeobservers will produce `ResizeObserverEntry` objects with non-null `borderBoxSize` values, but in this case we're constructing one by hand from JS.)

In Chrome, the testcase throws `Uncaught TypeError: Illegal constructor` for the `new ResizeObserverEntry(o1)` JS.
In my debug build, we abort on the first line here, because `value` (of type `ResizeObserverSize*`) is null:
```c++
template <class T, GetOrCreateReflectorWrapBehavior wrapBehavior>
MOZ_ALWAYS_INLINE bool DoGetOrCreateDOMReflector(
    JSContext* cx, T* value, JS::Handle<JSObject*> givenProto,
    JS::MutableHandle<JS::Value> rval) {
  MOZ_ASSERT(value);
```
...because we're trying to read the `borderBoxSize` from a default-constructed `ResizeObserverEntry` object, and it's null.

(I assume that actual resizeobservers will produce `ResizeObserverEntry` objects with non-null `borderBoxSize` values, but in this case we're constructing one by hand from JS, and it hasn't been given a borderBoxSize value.)

In Chrome, the testcase throws `Uncaught TypeError: Illegal constructor` for the `new ResizeObserverEntry(o1)` JS.

Back to Bug 1552911 Comment 1