Пример #1
0
    Atom ScriptObject::getMultinameProperty(const Multiname* multiname) const
    {
        if (multiname->isValidDynamicName())
        {
            return getStringProperty(multiname->getName());
        }
        else
        {
            Toplevel* toplevel = this->toplevel();

            if (multiname->isNsset())
                toplevel->throwReferenceError(kReadSealedErrorNs, multiname, traits());
            else
                toplevel->throwReferenceError(kReadSealedError, multiname, traits());
            return undefinedAtom;
        }
    }
Пример #2
0
	ScriptObject* DomainObject::finddef(const Multiname& multiname,
										DomainEnv* domainEnv)
	{
		Toplevel* toplevel = this->toplevel();

		ScriptEnv* script = (ScriptEnv*) domainEnv->getScriptInit(multiname);
		if (script == (ScriptEnv*)BIND_AMBIGUOUS)
            toplevel->throwReferenceError(kAmbiguousBindingError, multiname);

		if (script == (ScriptEnv*)BIND_NONE)
            toplevel->throwReferenceError(kUndefinedVarError, multiname);

		if (script->global == NULL)
		{
			script->initGlobal();
			Atom argv[1] = { script->global->atom() };
			script->coerceEnter(0, argv);
		}

		return script->global;
	}