1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00
otto/type_arguments.go
Robert Krimen 3c93384f5c Cleanup of stash, property, and object
Use octal to designate write/enumerate/configure (experimental)
Move extensibility responsibility into the stash
Rename propertyStash => objectStash (be congruent with arrayStash, etc.)
Get rid of a bunch of useless methods
Privatize everything ([A-Z] => [a-z_])
gofmt
2012-10-26 15:47:19 -07:00

17 lines
523 B
Go

package otto
func (runtime *_runtime) newArgumentsObject(argumentList []Value) *_object {
self := runtime.newClassObject("Arguments")
self.prototype = runtime.Global.ObjectPrototype
for index, value := range argumentList {
// TODO Write test for runtime.GetValue(value)
// The problem here is possible reference nesting, is this the right place to GetValue?
self.set(arrayIndexToString(uint(index)), runtime.GetValue(value), false)
}
self.stash.set("length", toValue(len(argumentList)), 0101)
return self
}