Changeset 33979 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- May 21, 2008, 6:20:45 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/API
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/APICast.h
r29663 r33979 109 109 inline JSGlobalContextRef toGlobalRef(KJS::ExecState* e) 110 110 { 111 ASSERT(!e->callingExecState());112 111 return reinterpret_cast<JSGlobalContextRef>(e); 113 112 } -
trunk/JavaScriptCore/API/JSBase.cpp
r33038 r33979 45 45 UString::Rep* scriptRep = toJS(script); 46 46 UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null; 47 47 48 // Interpreter::evaluate sets "this" to the global object if it is NULL 48 Completion completion = Interpreter::evaluate(exec->dynamicGlobalObject()->globalExec(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject); 49 JSGlobalObject* globalObject = exec->dynamicGlobalObject(); 50 Completion completion = Interpreter::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject); 49 51 50 52 if (completion.complType() == Throw) { -
trunk/JavaScriptCore/API/JSCallbackConstructor.cpp
r32652 r33979 57 57 } 58 58 59 bool JSCallbackConstructor::implementsConstruct() const 59 ConstructType JSCallbackConstructor::getConstructData(ConstructData&) 60 60 { 61 return true;61 return ConstructTypeNative; 62 62 } 63 63 -
trunk/JavaScriptCore/API/JSCallbackConstructor.h
r29663 r33979 33 33 namespace KJS { 34 34 35 class JSCallbackConstructor : public JSObject 36 { 35 class JSCallbackConstructor : public JSObject { 37 36 public: 38 37 JSCallbackConstructor(ExecState* exec, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback); … … 41 40 virtual bool implementsHasInstance() const; 42 41 43 virtual bool implementsConstruct() const;44 virtual JSObject* construct(ExecState*, const List &args);42 virtual ConstructType getConstructData(ConstructData&); 43 virtual JSObject* construct(ExecState*, const List& args); 45 44 46 45 virtual const ClassInfo *classInfo() const { return &info; } -
trunk/JavaScriptCore/API/JSCallbackObject.h
r30534 r33979 54 54 virtual bool deleteProperty(ExecState*, unsigned); 55 55 56 virtual bool implementsConstruct() const;56 virtual ConstructType getConstructData(ConstructData&); 57 57 virtual JSObject* construct(ExecState*, const List& args); 58 58 … … 60 60 virtual bool hasInstance(ExecState *exec, JSValue *value); 61 61 62 virtual bool implementsCall() const;62 virtual CallType getCallData(CallData&); 63 63 virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List &args); 64 64 -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r33038 r33979 238 238 239 239 template <class Base> 240 bool JSCallbackObject<Base>::implementsConstruct() const 240 ConstructType JSCallbackObject<Base>::getConstructData(ConstructData&) 241 241 { 242 242 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 243 243 if (jsClass->callAsConstructor) 244 return true;245 246 return false;244 return ConstructTypeNative; 245 246 return ConstructTypeNone; 247 247 } 248 248 … … 264 264 } 265 265 266 ASSERT(0); // implementsConstructshould prevent us from reaching here266 ASSERT(0); // getConstructData should prevent us from reaching here 267 267 return 0; 268 268 } … … 294 294 } 295 295 296 297 template <class Base> 298 bool JSCallbackObject<Base>::implementsCall() const 296 template <class Base> 297 CallType JSCallbackObject<Base>::getCallData(CallData&) 299 298 { 300 299 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 301 300 if (jsClass->callAsFunction) 302 return true;303 304 return false;301 return CallTypeNative; 302 303 return CallTypeNone; 305 304 } 306 305 … … 323 322 } 324 323 325 ASSERT_NOT_REACHED(); // implementsCallshould prevent us from reaching here324 ASSERT_NOT_REACHED(); // getCallData should prevent us from reaching here 326 325 return 0; 327 326 } … … 368 367 double JSCallbackObject<Base>::toNumber(ExecState* exec) const 369 368 { 369 // We need this check to guard against the case where this object is rhs of 370 // a binary expression where lhs threw an exception in its conversion to 371 // primitive 372 if (exec->hadException()) 373 return NaN; 370 374 JSContextRef ctx = toRef(exec); 371 375 JSObjectRef thisRef = toRef(this); -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r33038 r33979 299 299 { 300 300 JSObject* jsObject = toJS(object); 301 return jsObject->implementsConstruct(); 301 ConstructData constructData; 302 return jsObject->getConstructData(constructData) != ConstructTypeNone; 302 303 } 303 304 -
trunk/JavaScriptCore/API/JSValueRef.cpp
r33038 r33979 135 135 bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b) 136 136 { 137 JSLock lock; 138 ExecState* exec = toJS(ctx); 137 UNUSED_PARAM(ctx); 138 139 JSLock lock; 139 140 JSValue* jsA = toJS(a); 140 141 JSValue* jsB = toJS(b); 141 142 142 bool result = strictEqual(exec, jsA, jsB); // can't throw because it doesn't perform value conversion 143 ASSERT(!exec->hadException()); 143 bool result = strictEqual(jsA, jsB); 144 144 return result; 145 145 }
Note:
See TracChangeset
for help on using the changeset viewer.