func (e *GlobalEnvironment) CanDeclareGlobalFunction(n lang.String) {
	panic("TODO: properties")
}
CanDeclareGlobalFunction determines if a corresponding
CreateGlobalFunctionBinding call would succeed if called for the same given
name. CanDeclareGlobalFunction is specified in 8.1.1.4.16.
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)
}