Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
Merged the fix for dop251#151.
Browse files Browse the repository at this point in the history
  • Loading branch information
dop251 committed May 23, 2020
1 parent cb8f52d commit 91317b8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ func (s *valueStack) expand(idx int) {
}
}

func stashObjHas(obj objectImpl, name unistring.String) bool {
if obj.hasPropertyStr(name) {
if unscopables, ok := obj.getSym(symUnscopables, nil).(*Object); ok {
func stashObjHas(obj *Object, name unistring.String) bool {
if obj.self.hasPropertyStr(name) {
if unscopables, ok := obj.self.getSym(symUnscopables, nil).(*Object); ok {
if b := unscopables.self.getStr(name, nil); b != nil {
return !b.ToBoolean()
}
Expand Down Expand Up @@ -1504,9 +1504,9 @@ func (g getLocal) exec(vm *vm) {
}

type getVar struct {
name unistring.String
idx uint32
ref, callee bool
name unistring.String
idx uint32
ref, callee bool
}

func (g getVar) exec(vm *vm) {
Expand Down Expand Up @@ -1657,7 +1657,7 @@ func (n getVar1) exec(vm *vm) {
type getVar1Ref string

func (n getVar1Ref) exec(vm *vm) {
name := string(n)
name := unistring.String(n)
var val Value
for stash := vm.stash; stash != nil; stash = stash.outer {
if v, exists := stash.getByName(name, vm); exists {
Expand All @@ -1666,7 +1666,7 @@ func (n getVar1Ref) exec(vm *vm) {
}
}
if val == nil {
val = vm.r.globalObject.self.getStr(name)
val = vm.r.globalObject.self.getStr(name, nil)
if val == nil {
val = valueUnresolved{r: vm.r, ref: name}
}
Expand Down

0 comments on commit 91317b8

Please sign in to comment.