1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00

Fix global built-in attribute defaults (true, false, true)

This commit is contained in:
Robert Krimen 2013-06-03 18:26:44 -07:00
parent c6e033bf6c
commit 55565afada
2 changed files with 7 additions and 5 deletions

View File

@ -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(),

View File

@ -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) {