diff --git a/global.go b/global.go index f8fcb1f..0c1782f 100644 --- a/global.go +++ b/global.go @@ -701,7 +701,7 @@ func newContext() *_runtime { "undefined", UndefinedValue(), "NaN", NaNValue(), "Infinity", positiveInfinityValue(), - "eval", builtinGlobal_eval, + "eval", 1, builtinGlobal_eval, "parseInt", builtinGlobal_parseInt, "parseFloat", builtinGlobal_parseFloat, "isNaN", builtinGlobal_isNaN, diff --git a/global_test.go b/global_test.go index f02b115..a6dfcb7 100644 --- a/global_test.go +++ b/global_test.go @@ -43,6 +43,8 @@ func TestGlobal(t *testing.T) { test(`new Number().constructor == Number`, "true") test(`this.hasOwnProperty`, "[function]") + + test(`eval.length === 1`, "true") } func TestGlobalLength(t *testing.T) {