-
Notifications
You must be signed in to change notification settings - Fork 22
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
BAAS-16552: update goja to latest changes (part 1) #71
Conversation
…alue. See dop251#340 Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 4549f2c)
With this simplified code it skips some allocations of byte slices ``` benchstat old.bench new.bench name old time/op new time/op delta ASCIIConcat-8 44.3µs ± 5% 40.2µs ±12% -9.18% (p=0.000 n=10+10) name old alloc/op new alloc/op delta ASCIIConcat-8 14.0kB ± 0% 9.9kB ± 0% -29.28% (p=0.000 n=10+10) name old allocs/op new allocs/op delta ASCIIConcat-8 131 ± 0% 121 ± 0% -7.63% (p=0.000 n=10+10) ``` Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 989602c)
…or messages. Fixes dop251#343 Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 1309139)
…uplicate names. Fixes dop251#344. Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 676aa9f)
… but widely implemented Error.stack property. Closes dop251#337. Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 100e3a1)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit dd589aa)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 0bc6d0e)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 68467fa)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 06ae6b2)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 3649f4d)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 6e6f57d)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 336e1ad)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit d9c6733)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit f397cb3)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 1408985)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit c487fa8)
Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit d26b426)
… for the date being unset. Upgraded tc39 tests. Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 945df7a)
…ssable structs and arrays are copied in ToValue() so they remain writable in ES. Subsequent Export() returns the value including any changes made. Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 47311be)
…on-array values into slices. Fixes dop251#369, closes dop251#370. Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit 93b7349)
…o function. Do not treat callables (functions) as array-like when exporting to slices. Fixes dop251#369. Signed-off-by: Gabri <gabriele.cimato@gmail.com> (cherry picked from commit a23ee90)
Looks like some changes need to be pulled into this branch, but this LGTM otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM this looks great! I went through areas we know we have custom logic and am relying on these tests and baas tests for sanity checks
func toIntIgnoreNegZero(v Value) (int64, bool) { | ||
num := v.ToNumber() | ||
if i, ok := num.(valueInt); ok { | ||
return int64(i), true | ||
} | ||
if i, ok := num.(valueInt64); ok { | ||
return int64(i), true | ||
} | ||
if f, ok := num.(valueFloat); ok { | ||
if v == _negativeZero { | ||
return 0, true | ||
} | ||
if i, ok := floatToInt(float64(f)); ok { | ||
return i, true | ||
} | ||
} | ||
return 0, false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! This has been a minor pain historically
@@ -367,7 +367,6 @@ func TestMemCheck(t *testing.T) { | |||
`, | |||
7 + 3 + // Error "message" field + len("abc") | |||
4 + 5 + // Error "name" field + len("Error") | |||
5 + // Error "stack" field + len("") since stack is currently always set to an empty string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! Good too see this temporary stubbing go away
Included commits
addSrcMap()
whencompileVariableStatement()
andcompileLexicalDeclaration()
dop251/goja#353.throw "something"
dop251/goja#354.Compile
dop251/goja#352.parser.ParseFile
hangs when parsing "`" dop251/goja#351addSrcMap()
to typecompiledFunctionLiteral
. dop251/goja#347.BAAS patch
Link to baas patch running against baas 🤞🏼
Our changes
nil
now.