Changeset 163225 in webkit for trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
- Timestamp:
- Jan 31, 2014, 5:37:59 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r163195 r163225 35 35 #include "GetterSetter.h" 36 36 #include "JSArray.h" 37 #include "JSBoundFunction.h" 38 #include "JSFunctionInlines.h" 37 #include "JSBoundFunction.h" 39 38 #include "JSGlobalObject.h" 40 39 #include "JSNotAnObject.h" … … 111 110 } 112 111 113 JSFunction* JSFunction::createBuiltinFunction(VM& vm, FunctionExecutable* executable, JSGlobalObject* globalObject)114 {115 JSFunction* function = create(vm, executable, globalObject);116 function->putDirect(vm, vm.propertyNames->name, jsString(&vm, executable->name().string()), DontDelete | ReadOnly | DontEnum);117 function->putDirect(vm, vm.propertyNames->length, jsNumber(executable->parameterCount()), DontDelete | ReadOnly | DontEnum);118 return function;119 }120 121 112 ObjectAllocationProfile* JSFunction::createAllocationProfile(ExecState* exec, size_t inlineCapacity) 122 113 { … … 152 143 153 144 const String actualName = name(exec); 154 if (!actualName.isEmpty() || isHost OrBuiltinFunction())145 if (!actualName.isEmpty() || isHostFunction()) 155 146 return actualName; 156 147 … … 160 151 const SourceCode* JSFunction::sourceCode() const 161 152 { 162 if (isHost OrBuiltinFunction())153 if (isHostFunction()) 163 154 return 0; 164 155 return &jsExecutable()->source(); 165 }166 167 bool JSFunction::isHostOrBuiltinFunction() const168 {169 return isHostFunction() || isBuiltinFunction();170 }171 172 bool JSFunction::isBuiltinFunction() const173 {174 return !isHostFunction() && jsExecutable()->isBuiltinFunction();175 156 } 176 157 … … 297 278 return JSValue::encode(caller); 298 279 JSFunction* function = jsCast<JSFunction*>(caller); 299 if (function->isHost OrBuiltinFunction() || !function->jsExecutable()->isStrictMode())280 if (function->isHostFunction() || !function->jsExecutable()->isStrictMode()) 300 281 return JSValue::encode(caller); 301 282 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller"))); … … 319 300 { 320 301 JSFunction* thisObject = jsCast<JSFunction*>(object); 321 if (thisObject->isHost OrBuiltinFunction())302 if (thisObject->isHostFunction()) 322 303 return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); 323 304 … … 381 362 { 382 363 JSFunction* thisObject = jsCast<JSFunction*>(object); 383 if (!thisObject->isHost OrBuiltinFunction() && (mode == IncludeDontEnumProperties)) {364 if (!thisObject->isHostFunction() && (mode == IncludeDontEnumProperties)) { 384 365 // Make sure prototype has been reified. 385 366 PropertySlot slot(thisObject); … … 397 378 { 398 379 JSFunction* thisObject = jsCast<JSFunction*>(cell); 399 if (thisObject->isHost OrBuiltinFunction()) {380 if (thisObject->isHostFunction()) { 400 381 Base::put(thisObject, exec, propertyName, value, slot); 401 382 return; … … 445 426 { 446 427 JSFunction* thisObject = jsCast<JSFunction*>(object); 447 if (thisObject->isHost OrBuiltinFunction())428 if (thisObject->isHostFunction()) 448 429 return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); 449 430
Note:
See TracChangeset
for help on using the changeset viewer.