gojs/goja/builtin_function_test.go

22 lines
433 B
Go
Raw Normal View History

2025-11-30 21:28:09 +08:00
package goja
import (
"testing"
)
func TestHashbangInFunctionConstructor(t *testing.T) {
const SCRIPT = `
assert.throws(SyntaxError, function() {
new Function("#!")
});
`
testScriptWithTestLib(SCRIPT, _undefined, t)
}
func TestFunctionApplyNullArgArray(t *testing.T) {
const SCRIPT = `
assert.sameValue(0, (function() {return arguments.length}).apply(undefined, null))
`
testScriptWithTestLib(SCRIPT, _undefined, t)
}