diff --git a/global.go b/global.go index 37d0ec0..f9632ad 100644 --- a/global.go +++ b/global.go @@ -688,7 +688,7 @@ func newContext() *_runtime { ) self.GlobalObject.write( - _propertyMode(101), + _propertyMode(0101), "Object", toValue(self.Global.Object), "Function", toValue(self.Global.Function), "Array", toValue(self.Global.Array), @@ -700,10 +700,6 @@ func newContext() *_runtime { "Date", toValue(self.Global.Date), "Error", toValue(self.Global.Error), // TODO JSON - - // TODO Is _propertyMode(0) compatible with 3? - // _propertyMode(0), - _propertyMode(101), "undefined", UndefinedValue(), "NaN", NaNValue(), "Infinity", positiveInfinityValue(), diff --git a/global_test.go b/global_test.go index 793f364..be280e0 100644 --- a/global_test.go +++ b/global_test.go @@ -219,6 +219,12 @@ func Test_decodeURIComponent(t *testing.T) { test(`decodeURIComponent.length === 1`, "true") test(`decodeURIComponent.prototype === undefined`, "true") + + test(` + var global = Function('return this')(); + var abc = Object.getOwnPropertyDescriptor(global, "decodeURIComponent"); + [ abc.value === global.decodeURIComponent, abc.writable, abc.enumerable, abc.configurable ]; + `, "true,true,false,true") } func TestGlobal_skipEnumeration(t *testing.T) {