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

* Proper lowercasing for internal stuff * *Environment => *_stash * ExecutionContext => _scope * Simpler & shallower call/construct mechanics * Remove unnecessary fields & methods * Better scoping (no more stack): []*_scope => _scope.outer * Some speed improvements In preparation for #66
33 lines
496 B
Go
33 lines
496 B
Go
package otto
|
|
|
|
// _scope:
|
|
// entryFile
|
|
// entryIdx
|
|
// top?
|
|
// outer => nil
|
|
|
|
// _stash:
|
|
// lexical
|
|
// variable
|
|
//
|
|
// _thisStash (ObjectEnvironment)
|
|
// _fnStash
|
|
// _dclStash
|
|
|
|
// An ECMA-262 ExecutionContext
|
|
type _scope struct {
|
|
lexical _stash
|
|
variable _stash
|
|
this *_object
|
|
eval bool // Replace this with kind?
|
|
outer *_scope
|
|
}
|
|
|
|
func newScope(lexical _stash, variable _stash, this *_object) *_scope {
|
|
return &_scope{
|
|
lexical: lexical,
|
|
variable: variable,
|
|
this: this,
|
|
}
|
|
}
|