Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some TypedArray defineproperty tests are panicing #308

Closed
mstoykov opened this issue Jul 22, 2021 · 0 comments
Closed

Some TypedArray defineproperty tests are panicing #308

mstoykov opened this issue Jul 22, 2021 · 0 comments
Labels

Comments

@mstoykov
Copy link
Contributor

If you enable the sec-integer-indexed-exotic-objects-defineownproperty-p-desc you will see that a bunch of tests are failing such as test/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js which panics with (removed irrelevant parts):

panic({0x7b3a80, 0xca1d90})
        runtime/panic.go:1038 +0x215
github.com/dop251/goja.(*float64Array).set(0xc00014dee8, 0x0, {0x0, 0x0})
        github.com/dop251/goja/typedarrays.go:423 +0x28
github.com/dop251/goja.(*typedArrayObject)._putIdx(0xc0006a5b80, 0x0, {0x8de900, 0xc0006fc5a0}, 0x0)
        github.com/dop251/goja/typedarrays.go:518 +0x7b
github.com/dop251/goja.(*typedArrayObject)._defineIdxProperty(0xc0006a5b80, 0xc0006ef2c0, {0xc0006fc540, {0x8de738, 0xc0006f9e30}, 0x0, 0x0, 0x0, {0x0, 0x0}, ...}, ...)
        github.com/dop251/goja/typedarrays.go:565 +0xe7
github.com/dop251/goja.(*typedArrayObject).defineOwnPropertyStr(0xc0006a5b80, {0xc0006e013c, 0x1}, {0xc0006fc540, {0x8de738, 0xc0006f9e30}, 0x0, 0x0, 0x0, {0x0, ...}, ...}, ...)
        github.com/dop251/goja/typedarrays.go:572 +0xca
github.com/dop251/goja.(*Object).defineOwnProperty(0xc0006fc480, {0x8de998, 0xc0006e4d20}, {0xc0006fc540, {0x8de738, 0xc0006f9e30}, 0x0, 0x0, 0x0, {0x0, ...}, ...}, ...)
        github.com/dop251/goja/object.go:1423 +0x153
github.com/dop251/goja.(*Runtime).object_defineProperty(0x7b16e0, {{0x8de738, 0xc0006515f0}, {0xc0006f0d30, 0x3, 0xd}})
        github.com/dop251/goja/builtin_object.go:233 +0x1ec
github.com/dop251/goja.(*vm)._nativeCall(0xc000178c00, 0xc00065d720, 0x3)
        github.com/dop251/goja/vm.go:2544 +0x223
github.com/dop251/goja.call.exec(0x5, 0xc000178c00)
        github.com/dop251/goja/vm.go:2516 +0x6a6
github.com/dop251/goja.(*vm).run(0xc000178c00)
        github.com/dop251/goja/vm.go:401 +0x8b
github.com/dop251/goja.(*vm).try(0xc00011ea7a, 0x9)
        github.com/dop251/goja/vm.go:517 +0x1a4
github.com/dop251/goja.(*vm).runTry(...)
        github.com/dop251/goja/vm.go:522

From my quick investigation

v = v.ToNumber()

this is the line that makes v to be nil. Whether that is an error in ToNumber or the previous creation of the property at
prop, ok := a._defineOwnProperty(unistring.String(strconv.Itoa(idx)), a.getOwnPropIdx(valueInt(idx)), desc, throw)

is ... a more complicated question

@dop251 dop251 closed this as completed in 946559a Jul 24, 2021
@dop251 dop251 added the bug label Jul 24, 2021
Gabri3l added a commit to mongodb-forks/goja that referenced this issue Feb 4, 2022
…formats, ... (#47)

* Fixed typed arrays' defineProperty and indexing. Fixes dop251#308.
* Fix Proxy creation panicing on target not callable
* Do not modify sb for variadic calls as it breaks local variables resolution. Instead place a marker on stack and use it to count the number of args. Fixes dop251#311.
* Support patterns in catch clause. See dop251#305
* Fixed the handling of Symbol properties in destructuring assignments. Fixes dop251#312.
* Ensure ToPropertyKey happens earlier when assigning computed keys. Fixes dop251#312.
* Aligned detached buffer semantics with the latest specs. Fixes dop251#315.
* More typed arrays fixes
* Fixed accessor and property key function names. Fixes dop251#314.
* Fixed possible panic when sorting non-standard arrays.
* Added nil-safety checks for values returned by get*() methods
* Fixed panics in parser on some invalid inputs. Fixes dop251#318.
* Arrow function (dop251#319)
* Implemented arrow functions. See dop251#304.
* Define the name property for anonymous functions (including arrow functions)
* Treat "arguments" as a lexical binding to match the latest specification
* Allow arrow functions to contain 'use strict' for simple parameter lists. Fixes dop251#323.
* Fixed argument variable reference resolution in stashless functions
* Treat date-only formats as UTC and date-time as local timezone. Added support for additional datetime formats. Fixes dop251#281, fixes dop251#292.
* Use correct createArgsRest variant when arguments are not in stash. Fixes dop251#327
* Fixed formatting for go 1.17
* Report 'length' as own property for Go slices. Fixes dop251#328.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants