1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Object, Function, String, TypeError, etc. are not enumerable

This commit is contained in:
Robert Krimen
2013-02-24 16:21:47 -08:00
parent 30dbca3307
commit 5a7981beb6
2 changed files with 36 additions and 4 deletions

View File

@@ -637,6 +637,7 @@ func newContext() *_runtime {
)
self.GlobalObject.write(
_propertyMode(101),
"Object", toValue(self.Global.Object),
"Function", toValue(self.Global.Function),
"Array", toValue(self.Global.Array),
@@ -796,7 +797,7 @@ func (runtime *_runtime) defineError(name string) func(Value) *_object {
return error
}
runtime.GlobalObject.set(name, toValue(runtime.newGlobalFunction(
runtime.GlobalObject.stash.set(name, toValue(runtime.newGlobalFunction(
1,
// e.g. TypeError( ... )
name,
@@ -808,7 +809,7 @@ func (runtime *_runtime) defineError(name string) func(Value) *_object {
return toValue(errorFunction(valueOfArrayIndex(argumentList, 0)))
},
prototype,
)), false)
)), 0101)
return errorFunction
}