2024-02-24 21:00:04 +00:00
|
|
|
package otto
|
|
|
|
|
2024-04-04 14:46:14 +00:00
|
|
|
// An ECMA-262 ExecutionContext.
|
|
|
|
type scope struct {
|
|
|
|
lexical stasher
|
|
|
|
variable stasher
|
|
|
|
this *object
|
2024-02-24 21:00:04 +00:00
|
|
|
eval bool // Replace this with kind?
|
2024-04-04 14:46:14 +00:00
|
|
|
outer *scope
|
2024-02-24 21:00:04 +00:00
|
|
|
depth int
|
|
|
|
|
2024-04-04 14:46:14 +00:00
|
|
|
frame frame
|
2024-02-24 21:00:04 +00:00
|
|
|
}
|
|
|
|
|
2024-04-04 14:46:14 +00:00
|
|
|
func newScope(lexical stasher, variable stasher, this *object) *scope {
|
|
|
|
return &scope{
|
2024-02-24 21:00:04 +00:00
|
|
|
lexical: lexical,
|
|
|
|
variable: variable,
|
|
|
|
this: this,
|
|
|
|
}
|
|
|
|
}
|