Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 100
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20160306.1920 +Version: 0.7.2.99+git20160311.1829 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -1787,7 +1787,7 @@ // TODO: undocumented constructor node //LOG(LOG_INFO,"describeType:"<< Class<XML>::getInstanceS(root)->toXMLString_internal()); - return Class<XML>::getInstanceS(root); + return XML::createFromNode(root); } tiny_string ASObject::toJSON(std::vector<ASObject *> &path, IFunction *replacer, const tiny_string &spaces,const tiny_string& filter)
View file
lightspark.tar.xz/src/backends/input.cpp
Changed
@@ -303,7 +303,9 @@ if(m_sys->currentVm == NULL) return; - m_sys->currentVm->addEvent(m_sys->mainClip->getStage(), + _NR<Stage> stage = m_sys->mainClip->getStage(); + stage->incRef(); + m_sys->currentVm->addEvent(stage, _MR(Class<Event>::getInstanceS("mouseLeave"))); } @@ -414,6 +416,7 @@ if (keyevent->is_modifier) charcode = 0; + target->incRef(); m_sys->currentVm->addEvent(target, _MR(Class<KeyboardEvent>::getInstanceS(type, charcode, keyevent->hardware_keycode, keyevent->state))); }
View file
lightspark.tar.xz/src/backends/netutils.cpp
Changed
@@ -827,6 +827,7 @@ return false; if(evaluationResult == SecurityManager::NA_CROSSDOMAIN_POLICY) { + dispatcher->incRef(); getVm()->addEvent(dispatcher,_MR(Class<SecurityErrorEvent>::getInstanceS("SecurityError: " "connection to domain not allowed by securityManager"))); return false;
View file
lightspark.tar.xz/src/parsing/amf3_generator.cpp
Changed
@@ -476,7 +476,7 @@ if(legacyXML) xmlObj=Class<XMLDocument>::getInstanceS(xmlStr); else - xmlObj=Class<XML>::getInstanceS(xmlStr); + xmlObj=XML::createFromString(xmlStr); objMap.push_back(xmlObj); return _MR(xmlObj); }
View file
lightspark.tar.xz/src/scripting/abc_opcodes.cpp
Changed
@@ -2621,8 +2621,6 @@ if(!th->mi->hasDXNS()) throw Class<VerifyError>::getInstanceS("dxns without SET_DXNS"); - if (!th->defaultNamespaceUri.isNull()) - th->defaultNamespaceUri->decRef(); th->defaultNamespaceUri = _NR<ASString>(abstract_s(th->context->getString(n))); } @@ -2632,8 +2630,6 @@ if(!th->mi->hasDXNS()) throw Class<VerifyError>::getInstanceS("dxnslate without SET_DXNS"); - if (!th->defaultNamespaceUri.isNull()) - th->defaultNamespaceUri->decRef(); th->defaultNamespaceUri = _NR<ASString>(abstract_s(o->toString())); o->decRef(); }
View file
lightspark.tar.xz/src/scripting/flash/display/DisplayObject.h
Changed
@@ -117,8 +117,8 @@ throw RunTimeException("DisplayObject::hitTestImpl: Derived class must implement this!"); } - void constructionComplete(); public: + void constructionComplete(); tiny_string name; _NR<DisplayObject> invalidateQueueNext; _NR<LoaderInfo> loaderInfo;
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.cpp
Changed
@@ -57,6 +57,9 @@ loader(NullRef),bytesData(NullRef),loadStatus(STARTED),actionScriptVersion(3),swfVersion(0), childAllowsParent(true),uncaughtErrorEvents(NullRef),parentAllowsChild(true),frameRate(0) { + sharedEvents=_MR(Class<EventDispatcher>::getInstanceS()); + parameters = _MR(Class<ASObject>::getInstanceS()); + uncaughtErrorEvents = _MR(Class<UncaughtErrorEvents>::getInstanceS()); LOG(LOG_NOT_IMPLEMENTED,"LoaderInfo: childAllowsParent and parentAllowsChild always return true"); } @@ -66,12 +69,16 @@ loader(l),bytesData(NullRef),loadStatus(STARTED),actionScriptVersion(3),swfVersion(0), childAllowsParent(true),uncaughtErrorEvents(NullRef),parentAllowsChild(true),frameRate(0) { + sharedEvents=_MR(Class<EventDispatcher>::getInstanceS()); + parameters = _MR(Class<ASObject>::getInstanceS()); + uncaughtErrorEvents = _MR(Class<UncaughtErrorEvents>::getInstanceS()); LOG(LOG_NOT_IMPLEMENTED,"LoaderInfo: childAllowsParent and parentAllowsChild always return true"); } void LoaderInfo::sinit(Class_base* c) { CLASS_SETUP(c, EventDispatcher, _constructor, CLASS_SEALED); + c->isReusable = true; c->setDeclaredMethodByQName("loaderURL","",Class<IFunction>::getFunction(_getLoaderURL),GETTER_METHOD,true); c->setDeclaredMethodByQName("loader","",Class<IFunction>::getFunction(_getLoader),GETTER_METHOD,true); c->setDeclaredMethodByQName("content","",Class<IFunction>::getFunction(_getContent),GETTER_METHOD,true); @@ -115,6 +122,18 @@ securityDomain.reset(); waitedObject.reset(); bytesData.reset(); + contentType = "application/x-shockwave-flash"; + bytesLoaded = 0; + bytesTotal = 0; + loadStatus =STARTED; + actionScriptVersion = 3; + swfVersion = 0; + childAllowsParent = true; + uncaughtErrorEvents.reset(); + parentAllowsChild =true; + frameRate =0; + parameters.reset(); + uncaughtErrorEvents.reset(); } void LoaderInfo::resetState() @@ -204,16 +223,13 @@ { LoaderInfo* th=static_cast<LoaderInfo*>(obj); EventDispatcher::_constructor(obj,NULL,0); - th->sharedEvents=_MR(Class<EventDispatcher>::getInstanceS()); - th->parameters = _MR(Class<ASObject>::getInstanceS()); - th->uncaughtErrorEvents = _MR(Class<UncaughtErrorEvents>::getInstanceS()); return NULL; } ASFUNCTIONBODY(LoaderInfo,_getLoaderURL) { LoaderInfo* th=static_cast<LoaderInfo*>(obj); - return Class<ASString>::getInstanceS(th->loaderURL); + return abstract_s(th->loaderURL); } ASFUNCTIONBODY(LoaderInfo,_getContent) @@ -248,7 +264,7 @@ ASFUNCTIONBODY(LoaderInfo,_getURL) { LoaderInfo* th=static_cast<LoaderInfo*>(obj); - return Class<ASString>::getInstanceS(th->url); + return abstract_s(th->url); } ASFUNCTIONBODY(LoaderInfo,_getBytesLoaded) @@ -681,11 +697,14 @@ graphics.reset(); hitArea.reset(); hitTarget.reset(); + buttonMode = false; + useHandCursor = false; } void Sprite::sinit(Class_base* c) { CLASS_SETUP(c, DisplayObjectContainer, _constructor, CLASS_SEALED); + c->isReusable = true; c->setDeclaredMethodByQName("graphics","",Class<IFunction>::getFunction(_getGraphics),GETTER_METHOD,true); c->setDeclaredMethodByQName("startDrag","",Class<IFunction>::getFunction(_startDrag),NORMAL_METHOD,true); c->setDeclaredMethodByQName("stopDrag","",Class<IFunction>::getFunction(_stopDrag),NORMAL_METHOD,true); @@ -961,7 +980,7 @@ ASFUNCTIONBODY(FrameLabel,_getName) { FrameLabel* th=static_cast<FrameLabel*>(obj); - return Class<ASString>::getInstanceS(th->name); + return abstract_s(th->name); } /* @@ -1021,7 +1040,7 @@ ASFUNCTIONBODY(Scene,_getName) { Scene* th=static_cast<Scene*>(obj); - return Class<ASString>::getInstanceS(th->name); + return abstract_s(th->name); } ASFUNCTIONBODY(Scene,_getNumFrames) @@ -1083,6 +1102,7 @@ void MovieClip::sinit(Class_base* c) { CLASS_SETUP(c, Sprite, _constructor, CLASS_DYNAMIC_NOT_FINAL); + c->isReusable = true; c->setDeclaredMethodByQName("currentFrame","",Class<IFunction>::getFunction(_getCurrentFrame),GETTER_METHOD,true); c->setDeclaredMethodByQName("totalFrames","",Class<IFunction>::getFunction(_getTotalFrames),GETTER_METHOD,true); c->setDeclaredMethodByQName("framesLoaded","",Class<IFunction>::getFunction(_getFramesLoaded),GETTER_METHOD,true); @@ -1122,6 +1142,9 @@ Sprite::finalize(); frames.clear(); frameScripts.clear(); + fromDefineSpriteTag = false; + totalFrames_unreliable = 1; + enabled = true; } /* Returns a Scene_data pointer for a scene called sceneName, or for @@ -1382,7 +1405,7 @@ { for(size_t j=0;j<th->scenes[i].labels.size();++j) if(th->scenes[i].labels[j].frame == th->state.FP) - return Class<ASString>::getInstanceS(th->scenes[i].labels[j].name); + return abstract_s(th->scenes[i].labels[j].name); } return getSys()->getNullRef(); } @@ -1407,7 +1430,7 @@ if(label.empty()) return getSys()->getNullRef(); else - return Class<ASString>::getInstanceS(label); + return abstract_s(label); } ASFUNCTIONBODY(MovieClip,_getCurrentLabels) @@ -1451,6 +1474,7 @@ void DisplayObjectContainer::sinit(Class_base* c) { CLASS_SETUP(c, InteractiveObject, _constructor, CLASS_SEALED); + c->isReusable = true; c->setDeclaredMethodByQName("numChildren","",Class<IFunction>::getFunction(_getNumChildren),GETTER_METHOD,true); c->setDeclaredMethodByQName("getChildIndex","",Class<IFunction>::getFunction(_getChildIndex),NORMAL_METHOD,true); c->setDeclaredMethodByQName("setChildIndex","",Class<IFunction>::getFunction(_setChildIndex),NORMAL_METHOD,true); @@ -1498,7 +1522,7 @@ multiname objName(NULL); objName.name_type=multiname::NAME_STRING; objName.name_s_id=getSys()->getUniqueStringId(obj->name); - objName.ns.push_back(nsNameAndKind("",NAMESPACE)); + objName.ns.emplace_back("",NAMESPACE); setVariableByMultiname(objName,getSys()->getNullRef(), ASObject::CONST_NOT_ALLOWED); } @@ -1522,7 +1546,7 @@ multiname objName(NULL); objName.name_type=multiname::NAME_STRING; objName.name_s_id=getSys()->getUniqueStringId(obj->name); - objName.ns.push_back(nsNameAndKind("",NAMESPACE)); + objName.ns.emplace_back("",NAMESPACE); setVariableByMultiname(objName,obj,ASObject::CONST_NOT_ALLOWED); } @@ -1554,6 +1578,8 @@ InteractiveObject::finalize(); //Release every child dynamicDisplayList.clear(); + mouseChildren = true; + tabChildren = true; } InteractiveObject::InteractiveObject(Class_base* c):DisplayObject(c),mouseEnabled(true),doubleClickEnabled(false),accessibilityImplementation(NullRef),contextMenu(NullRef),tabEnabled(false),tabIndex(-1) @@ -1609,6 +1635,11 @@ { DisplayObject::finalize(); contextMenu.reset(); + mouseEnabled = true; + doubleClickEnabled =false; + accessibilityImplementation.reset(); + tabEnabled = false; + tabIndex = -1; } void InteractiveObject::buildTraits(ASObject* o) @@ -1618,6 +1649,7 @@ void InteractiveObject::sinit(Class_base* c) { CLASS_SETUP(c, DisplayObject, _constructor, CLASS_SEALED); + c->isReusable = true; c->setDeclaredMethodByQName("mouseEnabled","",Class<IFunction>::getFunction(_setMouseEnabled),SETTER_METHOD,true); c->setDeclaredMethodByQName("mouseEnabled","",Class<IFunction>::getFunction(_getMouseEnabled),GETTER_METHOD,true); c->setDeclaredMethodByQName("doubleClickEnabled","",Class<IFunction>::getFunction(_setDoubleClickEnabled),SETTER_METHOD,true); @@ -2283,13 +2315,13 @@ switch(getSys()->scaleMode) {
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.h
Changed
@@ -475,9 +475,9 @@ protected: /* This is read from the SWF header. It's only purpose is for flash.display.MovieClip.totalFrames */ uint32_t totalFrames_unreliable; - void constructionComplete(); ASPROPERTY_GETTER_SETTER(bool, enabled); public: + void constructionComplete(); RunState state; MovieClip(Class_base* c); MovieClip(Class_base* c, const FrameContainer& f, bool defineSpriteTag);
View file
lightspark.tar.xz/src/scripting/flash/net/XMLSocket.cpp
Changed
@@ -167,7 +167,6 @@ XMLSocket::~XMLSocket() { - finalize(); } void XMLSocket::sinit(Class_base* c) @@ -196,6 +195,7 @@ job->threadAbort(); job = NULL; } + timeout = 20000; } ASFUNCTIONBODY_GETTER_SETTER(XMLSocket, timeout); @@ -378,10 +378,12 @@ { if (!sock.connect(hostname, port)) { + owner->incRef(); getVm()->addEvent(owner, _MR(Class<IOErrorEvent>::getInstanceS())); return; } + owner->incRef(); getVm()->addEvent(owner, _MR(Class<Event>::getInstanceS("connect"))); struct timeval timeout; @@ -402,6 +404,7 @@ int status = select(maxfd+1, &readfds, NULL, NULL, &timeout); if (status < 0) { + owner->incRef(); getVm()->addEvent(owner, _MR(Class<IOErrorEvent>::getInstanceS())); return; } @@ -413,6 +416,7 @@ ssize_t nbytes = read(signalListener, &cmd, 1); if (nbytes < 0) { + owner->incRef(); getVm()->addEvent(owner, _MR(Class<IOErrorEvent>::getInstanceS())); return; } @@ -444,17 +448,20 @@ { buf[nbytes] = '\0'; tiny_string data(buf, true); + owner->incRef(); getVm()->addEvent(owner, _MR(Class<DataEvent>::getInstanceS(data))); } else if (nbytes == 0) { // The server has closed the socket + owner->incRef(); getVm()->addEvent(owner, _MR(Class<Event>::getInstanceS("close"))); threadAborting = true; } else { // Error + owner->incRef(); getVm()->addEvent(owner, _MR(Class<IOErrorEvent>::getInstanceS())); threadAborting = true; }
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -65,13 +65,27 @@ void XML::finalize() { - ASObject::finalize(); + xmldoc.reset(); + parentNode.reset(); + nodetype =(pugi::xml_node_type)0; + isAttribute = false; + constructed = false; + childrenlist.reset(); + nodename.clear(); + nodevalue.clear(); + nodenamespace_uri.clear(); + nodenamespace_prefix.clear(); + attributelist.reset(); + procinstlist.reset(); + namespacedefs.clear(); + } void XML::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructor, CLASS_FINAL); setDefaultXMLSettings(); + c->isReusable=true; c->setDeclaredMethodByQName("ignoreComments","",Class<IFunction>::getFunction(_getIgnoreComments),GETTER_METHOD,false); c->setDeclaredMethodByQName("ignoreComments","",Class<IFunction>::getFunction(_setIgnoreComments),SETTER_METHOD,false); @@ -139,7 +153,7 @@ args[0]->is<Null>() || args[0]->is<Undefined>()) { - return Class<XML>::getInstanceS(""); + return Class<XML>::getInstanceSNoArgs(); } else if(args[0]->is<ASString>() || args[0]->is<Number>() || @@ -147,7 +161,7 @@ args[0]->is<UInteger>() || args[0]->is<Boolean>()) { - return Class<XML>::getInstanceS(args[0]->toString()); + return createFromString(args[0]->toString()); } else if(args[0]->is<XML>()) { @@ -162,11 +176,11 @@ } else if(args[0]->is<XMLNode>()) { - return Class<XML>::getInstanceS(args[0]->as<XMLNode>()->node); + return createFromNode(args[0]->as<XMLNode>()->node); } else { - return Class<XML>::getInstanceS(args[0]->toString()); + return createFromString(args[0]->toString()); } } @@ -228,7 +242,7 @@ { XML* th=Class<XML>::cast(obj); assert_and_throw(argslen==0); - return Class<ASString>::getInstanceS(th->nodekindString()); + return abstract_s(th->nodekindString()); } const char *XML::nodekindString() { @@ -266,7 +280,7 @@ if(!th->isAttribute && (th->nodetype==pugi::node_pcdata || th->nodetype==pugi::node_comment || th->nodetype==pugi::node_null)) return getSys()->getNullRef(); else - return Class<ASString>::getInstanceS(th->nodename); + return abstract_s(th->nodename); } ASFUNCTIONBODY(XML,name) @@ -288,7 +302,7 @@ { XML* th=Class<XML>::cast(obj); _NR<ASObject> name; - ARG_UNPACK(name,_NR<ASObject>(Class<ASString>::getInstanceS("*"))); + ARG_UNPACK(name,_NR<ASObject>(abstract_s("*"))); XMLVector ret; multiname mname(NULL); name->applyProxyProperty(mname); @@ -318,7 +332,7 @@ //The appendChild specs says that any other type is converted to string //NOTE: this is explicitly different from XML constructor, that will only convert to //string Numbers and Booleans - arg=_MR(Class<XML>::getInstanceS("dummy")); + arg=_MR(createFromString("dummy")); //avoid interpretation of the argument, just set it as text node arg->setTextContent(args[0]->toString()); } @@ -366,13 +380,16 @@ XMLVector tmp; XMLList* res = Class<XMLList>::getInstanceS(tmp,th->getChildrenlist(),multiname(NULL)); - for (XMLList::XMLListVector::const_iterator it = th->attributelist->nodes.begin(); it != th->attributelist->nodes.end(); it++) + if (!th->attributelist.isNull()) { - _R<XML> attr = *it; - if (attr->nodenamespace_uri == tmpns && (attrname== "*" || attr->nodename == attrname)) + for (XMLList::XMLListVector::const_iterator it = th->attributelist->nodes.begin(); it != th->attributelist->nodes.end(); it++) { - attr->incRef(); - res->append(attr); + _R<XML> attr = *it; + if (attr->nodenamespace_uri == tmpns && (attrname== "*" || attr->nodename == attrname)) + { + attr->incRef(); + res->append(attr); + } } } return res; @@ -582,21 +599,24 @@ res += getVm()->getDefaultXMLNamespace(); res += "\""; } - for (XMLList::XMLListVector::const_iterator it = attributelist->nodes.begin(); it != attributelist->nodes.end(); it++) + if (!attributelist.isNull()) { - _R<XML> attr = *it; - res += " "; - if (attr->nodenamespace_prefix != "") + for (XMLList::XMLListVector::const_iterator it = attributelist->nodes.begin(); it != attributelist->nodes.end(); it++) { - res += attr->nodenamespace_prefix; - res += ":"; + _R<XML> attr = *it; + res += " "; + if (attr->nodenamespace_prefix != "") + { + res += attr->nodenamespace_prefix; + res += ":"; + } + res += attr->nodename; + res += "=\""; + res += encodeToXML(attr->nodevalue,true); + res += "\""; } - res += attr->nodename; - res += "=\""; - res += encodeToXML(attr->nodevalue,true); - res += "\""; } - if (childrenlist->nodes.size() == 0) + if (childrenlist.isNull() || childrenlist->nodes.size() == 0) { res += "/>"; break; @@ -604,6 +624,7 @@ res += ">"; tiny_string newindent; bool bindent = (pretty && prettyPrinting && prettyIndent >=0 && + !childrenlist.isNull() && (childrenlist->nodes.size() >1 || (!childrenlist->nodes[0]->procinstlist.isNull()) || (childrenlist->nodes[0]->nodetype != pugi::node_pcdata && childrenlist->nodes[0]->nodetype != pugi::node_cdata))); @@ -615,13 +636,16 @@ newindent += " "; } } - for (uint32_t i = 0; i < childrenlist->nodes.size(); i++) + if (!childrenlist.isNull()) { - _R<XML> child= childrenlist->nodes[i]; - tiny_string tmpres = child->toXMLString_internal(pretty,defaultnsprefix,newindent.raw_buf(),false); - if (bindent && !tmpres.empty()) - res += "\n"; - res += tmpres; + for (uint32_t i = 0; i < childrenlist->nodes.size(); i++) + { + _R<XML> child= childrenlist->nodes[i]; + tiny_string tmpres = child->toXMLString_internal(pretty,defaultnsprefix,newindent.raw_buf(),false); + if (bindent && !tmpres.empty()) + res += "\n"; + res += tmpres; + } } if (bindent) { @@ -664,25 +688,28 @@ XML* th=Class<XML>::cast(obj); assert_and_throw(argslen==0); tiny_string res = th->toXMLString_internal(); - ASString* ret=Class<ASString>::getInstanceS(res); + ASString* ret=abstract_s(res); return ret; } void XML::childrenImpl(XMLVector& ret, const tiny_string& name) { - for (uint32_t i = 0; i < childrenlist->nodes.size(); i++) + if (!childrenlist.isNull()) {
View file
lightspark.tar.xz/src/scripting/toplevel/XML.h
Changed
@@ -143,6 +143,8 @@ static bool getPrettyPrinting(); static unsigned int getParseMode(); + static XML* createFromString(const tiny_string& s); + static XML* createFromNode(const pugi::xml_node& _n, XML* parent=NULL, bool fromXMLList=false); const tiny_string getName() const { return nodename;} const tiny_string getNamespaceURI() const { return nodenamespace_uri;}
View file
lightspark.tar.xz/src/scripting/toplevel/XMLList.cpp
Changed
@@ -84,13 +84,16 @@ { if (targetobject) targetobject->decRef(); - //nodes.clear(); - ASObject::finalize(); + nodes.clear(); + constructed = false; + targetobject = NULL; + targetproperty = multiname(this->getClass()->memoryAccount); } void XMLList::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructor, CLASS_FINAL); + c->isReusable=true; c->setDeclaredMethodByQName("length","",Class<IFunction>::getFunction(_getLength),NORMAL_METHOD,true); c->setDeclaredMethodByQName("attribute",AS3,Class<IFunction>::getFunction(attribute),NORMAL_METHOD,true); c->setDeclaredMethodByQName("attributes",AS3,Class<IFunction>::getFunction(attributes),NORMAL_METHOD,true); @@ -230,7 +233,7 @@ pugi::xml_node_iterator it=xmldoc.begin(); for(;it!=xmldoc.end();++it) { - _R<XML> tmp = _MR(Class<XML>::getInstanceS(*it,(XML*)NULL,true)); + _R<XML> tmp = _MR(XML::createFromNode(*it,(XML*)NULL,true)); if (tmp->constructed) nodes.push_back(tmp); } @@ -311,7 +314,7 @@ assert(obj==NULL); if(argslen==0) { - return Class<XMLList>::getInstanceS(""); + return Class<XMLList>::getInstanceSNoArgs(); } else if(args[0]->is<ASString>() || args[0]->is<Number>() || @@ -336,7 +339,7 @@ else if(args[0]->getObjectType()==T_NULL || args[0]->getObjectType()==T_UNDEFINED) { - return Class<XMLList>::getInstanceS(); + return Class<XMLList>::getInstanceSNoArgs(); } else throw RunTimeException("Type not supported in XMLList()"); @@ -346,7 +349,7 @@ { XMLList* th=Class<XMLList>::cast(obj); _NR<ASObject> name; - ARG_UNPACK(name,_NR<ASObject>(Class<ASString>::getInstanceS("*"))); + ARG_UNPACK(name,_NR<ASObject>(abstract_s("*"))); XML::XMLVector ret; multiname mname(NULL); name->applyProxyProperty(mname); @@ -473,7 +476,7 @@ ASFUNCTIONBODY(XMLList,copy) { XMLList* th = obj->as<XMLList>(); - XMLList *dest = Class<XMLList>::getInstanceS(); + XMLList *dest = Class<XMLList>::getInstanceSNoArgs(); dest->targetobject = th->targetobject; auto it=th->nodes.begin(); for(; it!=th->nodes.end(); ++it) @@ -495,7 +498,7 @@ multiname mname(NULL); mname.name_type=multiname::NAME_STRING; mname.name_s_id=getSys()->getUniqueStringId(attrname); - mname.ns.push_back(nsNameAndKind("",NAMESPACE)); + mname.ns.emplace_back("",NAMESPACE); mname.isAttribute = true; _NR<ASObject> attr=th->getVariableByMultiname(mname, NONE); @@ -507,7 +510,7 @@ ASFUNCTIONBODY(XMLList,attributes) { XMLList *th = obj->as<XMLList>(); - XMLList *res = Class<XMLList>::getInstanceS(); + XMLList *res = Class<XMLList>::getInstanceSNoArgs(); auto it=th->nodes.begin(); for(; it!=th->nodes.end(); ++it) { @@ -521,7 +524,7 @@ { XMLList* th=Class<XMLList>::cast(obj); - XMLList *res = Class<XMLList>::getInstanceS(); + XMLList *res = Class<XMLList>::getInstanceSNoArgs(); XML::XMLVector nodecomments; auto it=th->nodes.begin(); for(; it!=th->nodes.end(); ++it) @@ -537,7 +540,7 @@ tiny_string name; ARG_UNPACK(name,"*"); - XMLList *res = Class<XMLList>::getInstanceS(); + XMLList *res = Class<XMLList>::getInstanceSNoArgs(); XML::XMLVector nodeprocessingInstructions; auto it=th->nodes.begin(); for(; it!=th->nodes.end(); ++it) @@ -674,7 +677,7 @@ //delegate to ASString if(res.isNull() && nodes.size()==1 && nodes[0]->hasSimpleContent()) { - ASString *contentstr=Class<ASString>::getInstanceS(nodes[0]->toString_priv()); + ASString *contentstr=abstract_s(nodes[0]->toString_priv()); res=contentstr->getVariableByMultiname(name, opt); contentstr->decRef(); } @@ -795,20 +798,20 @@ throwError<TypeError>(kXMLAssigmentOneItemLists); if (!tmpprop.isEmpty()) { - XML* tmp = Class<XML>::getInstanceS(); + XML* tmp = Class<XML>::getInstanceSNoArgs(); tmp->nodetype = pugi::node_element; tmp->nodename = targetproperty.normalizedName(); - tmp->attributelist = _MR(Class<XMLList>::getInstanceS()); + tmp->attributelist = _MR(Class<XMLList>::getInstanceSNoArgs()); tmp->constructed = true; tmp->setVariableByMultiname(name,o,allowConst); tmp->incRef(); tiny_string tmpname = tmpprop.normalizedName(); if (retnodes.empty() && tmpname != "" && tmpname != "*") { - XML* tmp2 = Class<XML>::getInstanceS(); + XML* tmp2 = Class<XML>::getInstanceSNoArgs(); tmp2->nodetype = pugi::node_element; tmp2->nodename = tmpname; - tmp2->attributelist = _MR(Class<XMLList>::getInstanceS()); + tmp2->attributelist = _MR(Class<XMLList>::getInstanceSNoArgs()); tmp2->constructed = true; tmp2->setVariableByMultiname(targetproperty,tmp,allowConst); tmp2->incRef(); @@ -933,7 +936,7 @@ else { tiny_string str = x->toString(); - append(_MR(Class<XML>::getInstanceS(str))); + append(_MR(XML::createFromString(str))); } } @@ -985,7 +988,7 @@ multiname m(NULL); m.name_type = multiname::NAME_INT; m.name_i = i; - m.ns.push_back(nsNameAndKind("",NAMESPACE)); + m.ns.emplace_back("",NAMESPACE); targetobject->setVariableByMultiname(m,o,allowConst); break; } @@ -1011,13 +1014,13 @@ multiname m(NULL); m.name_type = multiname::NAME_INT; m.name_i = idx; - m.ns.push_back(nsNameAndKind("",NAMESPACE)); + m.ns.emplace_back("",NAMESPACE); targetobject->setVariableByMultiname(m,o,allowConst); } if (o->as<XML>()->getNodeKind() == pugi::node_pcdata) { nodes[idx]->childrenlist->clear(); - _R<XML> tmp = _MR<XML>(Class<XML>::getInstanceS()); + _R<XML> tmp = _MR<XML>(Class<XML>::getInstanceSNoArgs()); nodes[idx]->incRef(); tmp->parentNode = nodes[idx]; tmp->nodetype = pugi::node_pcdata; @@ -1041,7 +1044,7 @@ else { nodes[idx]->childrenlist->clear(); - _R<XML> tmp = _MR<XML>(Class<XML>::getInstanceS()); + _R<XML> tmp = _MR<XML>(Class<XML>::getInstanceSNoArgs()); nodes[idx]->incRef(); tmp->parentNode = nodes[idx]; tmp->nodetype = pugi::node_pcdata; @@ -1101,7 +1104,7 @@ ASFUNCTIONBODY(XMLList,_toString) { XMLList* th=Class<XMLList>::cast(obj); - return Class<ASString>::getInstanceS(th->toString_priv()); + return abstract_s(th->toString_priv()); } tiny_string XMLList::toXMLString_internal(bool pretty) @@ -1125,7 +1128,7 @@ { XMLList* th=Class<XMLList>::cast(obj); assert_and_throw(argslen==0); - ASString* ret=Class<ASString>::getInstanceS(th->toXMLString_internal()); + ASString* ret=abstract_s(th->toXMLString_internal()); return ret; }
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.cpp
Changed
@@ -255,7 +255,7 @@ // TODO: accessor LOG(LOG_NOT_IMPLEMENTED, "describeType for Function not completely implemented"); - return Class<XML>::getInstanceS(root); + return XML::createFromNode(root); } SyntheticFunction::SyntheticFunction(Class_base* c,method_info* m):IFunction(c),mi(m),val(NULL) @@ -1265,7 +1265,7 @@ node=root.append_child("factory"); node.append_attribute("type").set_value(getQualifiedClassName().raw_buf()); describeInstance(node); - return Class<XML>::getInstanceS(root); + return XML::createFromNode(root); } void Class_base::describeInstance(pugi::xml_node& root) const
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.