Changeset 69516 in webkit for trunk/JavaScriptCore/runtime/Error.cpp
- Timestamp:
- Oct 11, 2010, 12:12:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Error.cpp
r60762 r69516 196 196 } 197 197 198 class StrictModeTypeErrorFunction : public InternalFunction { 199 public: 200 StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, const UString& message) 201 : InternalFunction(&exec->globalData(), globalObject, structure, exec->globalData().propertyNames->emptyIdentifier) 202 , m_message(message) 203 { 204 } 205 206 static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec) 207 { 208 throwTypeError(exec, static_cast<StrictModeTypeErrorFunction*>(exec->callee())->m_message); 209 return JSValue::encode(jsNull()); 210 } 211 212 ConstructType getConstructData(ConstructData& constructData) 213 { 214 constructData.native.function = constructThrowTypeError; 215 return ConstructTypeHost; 216 } 217 218 static EncodedJSValue JSC_HOST_CALL callThrowTypeError(ExecState* exec) 219 { 220 throwTypeError(exec, static_cast<StrictModeTypeErrorFunction*>(exec->callee())->m_message); 221 return JSValue::encode(jsNull()); 222 } 223 224 CallType getCallData(CallData& callData) 225 { 226 callData.native.function = callThrowTypeError; 227 return CallTypeHost; 228 } 229 230 private: 231 UString m_message; 232 }; 233 234 COMPILE_ASSERT(sizeof(StrictModeTypeErrorFunction) <= sizeof(CollectorCell), sizeof_StrictModeTypeErrorFunction_must_be_less_than_CollectorCell); 235 236 JSValue createTypeErrorFunction(ExecState* exec, const UString& message) 237 { 238 return new (exec) StrictModeTypeErrorFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->internalFunctionStructure(), message); 239 } 240 198 241 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.