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

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
17 lines
523 B
Go
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
|
|
}
|
|
|