func (e *GlobalEnvironment) HasBinding(n lang.String) bool {
	return e.DeclarativeRecord.HasBinding(n) || e.ObjectRecord.HasBinding(n)
}
/* -- implements Environment --
HasBinding  determines if the argument identifier is one of the identifiers
bound by the record.
HasBinding is specified in 8.1.1.4.1.
package binding
import (
	"fmt"
	"github.com/gojisvm/gojis/internal/runtime/errors"
	"github.com/gojisvm/gojis/internal/runtime/lang"
)
var _ Environment = (*GlobalEnvironment)(nil)
type GlobalEnvironment struct {
	ObjectRecord      *ObjectEnvironment
	GlobalThisValue   *lang.Object
	DeclarativeRecord *DeclarativeEnvironment
	VarNames          []string
}
func (e *GlobalEnvironment) Outer() Environment {
	return nil
}
func (e *GlobalEnvironment) GetThisBinding() (lang.Value, errors.Error) {
	return e.GlobalThisValue, nil
}
func (e *GlobalEnvironment) HasVarDeclaration(n lang.String) bool {
	nVal := n.Value().(string)
	for _, varName := range e.VarNames {
		if varName == nVal {
			return true
		}
	}
	return false
}
func (e *GlobalEnvironment) HasLexicalDeclaration(n lang.String) bool {
	return e.DeclarativeRecord.HasBinding(n)
}
func (e *GlobalEnvironment) HasRestrictedGlobalProperty(n lang.String) bool {
	existingProp := e.ObjectRecord.bindingObject.GetOwnProperty(lang.NewStringOrSymbol(n)).Value()
	if existingProp == lang.Undefined {
		return false
	}
	panic("#43: 8.1.1.4.14")
}
func (e *GlobalEnvironment) CanDeclareGlobalVar(n lang.String) bool {
	globalObj := e.ObjectRecord.bindingObject
	if lang.HasOwnProperty(globalObj, lang.NewStringOrSymbol(n)) {
		return true
	}
	return lang.InternalIsExtensible(globalObj)
}
func (e *GlobalEnvironment) CanDeclareGlobalFunction(n lang.String) {
	panic("TODO: properties")
}
func (e *GlobalEnvironment) CreateGlobalVarBinding(n lang.String, deletable bool) {
	globalObj := e.ObjectRecord.bindingObject
	hasProperty := lang.HasOwnProperty(globalObj, lang.NewStringOrSymbol(n))
	extensible := lang.InternalIsExtensible(globalObj)
	if !hasProperty.Value().(bool) && extensible {
		_ = e.ObjectRecord.CreateMutableBinding(n, deletable)
		_ = e.ObjectRecord.InitializeBinding(n, lang.Undefined)
	}
	if !e.HasVarDeclaration(n) {
		e.VarNames = append(e.VarNames, n.Value().(string))
	}
}
func (e *GlobalEnvironment) CreateGlobalFunctionBinding(n lang.String, val lang.Value, deletable bool) {
	panic("TODO: properties")
}