mirror of
https://github.com/robertkrimen/otto
synced 2025-10-19 19:55:30 +08:00
Fix global built-in attribute defaults (true, false, true)
This commit is contained in:
parent
c6e033bf6c
commit
55565afada
|
@ -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(),
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user