CREATE_DOM_NODE_WRAPPER(exec, globalObject, Text, text);

 


​​view plain​​ ​​copy to clipboard​​ ​​print​​ ​​?​​


  1. #define CREATE_DOM_NODE_WRAPPER(exec, globalObject, className, object) createDOMNodeWrapper<JS##className>(exec, globalObject, static_cast<className*>(object))  
  2. template<class WrapperClass, class DOMClass> inline JSNode* createDOMNodeWrapper(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMClass* node)  
  3.    {  
  4.        ASSERT(node);  
  5.        ASSERT(!getCachedDOMNodeWrapper(exec, node->document(), node));  
  6. new (exec) WrapperClass(getDOMStructure<WrapperClass>(exec, globalObject), globalObject, node);  
  7. // FIXME: The entire function can be removed, once we fix caching.  
  8. // This function is a one-off hack to make Nodes cache in the right global object.  
  9.        cacheDOMNodeWrapper(exec, node->document(), node, wrapper);  
  10. return wrapper;  
  11.    }