]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - API/JSCallbackObjectFunctions.h
JavaScriptCore-903.5.tar.gz
[apple/javascriptcore.git] / API / JSCallbackObjectFunctions.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include "APIShims.h"
28#include "APICast.h"
29#include "Error.h"
30#include "ExceptionHelpers.h"
31#include "JSCallbackFunction.h"
32#include "JSClassRef.h"
33#include "JSFunction.h"
34#include "JSGlobalObject.h"
35#include "JSLock.h"
36#include "JSObjectRef.h"
37#include "JSString.h"
38#include "JSStringRef.h"
39#include "OpaqueJSString.h"
40#include "PropertyNameArray.h"
41#include <wtf/Vector.h>
42
43namespace JSC {
44
45template <class Base>
46inline JSCallbackObject<Base>* JSCallbackObject<Base>::asCallbackObject(JSValue value)
47{
48 ASSERT(asObject(value)->inherits(&s_info));
49 return static_cast<JSCallbackObject*>(asObject(value));
50}
51
52template <class Base>
53JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, void* data)
54 : Base(globalObject, structure)
55 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass)))
56{
57 ASSERT(Base::inherits(&s_info));
58 init(exec);
59}
60
61// Global object constructor.
62// FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one.
63template <class Base>
64JSCallbackObject<Base>::JSCallbackObject(JSGlobalData& globalData, JSClassRef jsClass, Structure* structure)
65 : Base(globalData, structure)
66 , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass)))
67{
68 ASSERT(Base::inherits(&s_info));
69 ASSERT(Base::isGlobalObject());
70 init(static_cast<JSGlobalObject*>(this)->globalExec());
71}
72
73template <class Base>
74void JSCallbackObject<Base>::init(ExecState* exec)
75{
76 ASSERT(exec);
77
78 Vector<JSObjectInitializeCallback, 16> initRoutines;
79 JSClassRef jsClass = classRef();
80 do {
81 if (JSObjectInitializeCallback initialize = jsClass->initialize)
82 initRoutines.append(initialize);
83 } while ((jsClass = jsClass->parentClass));
84
85 // initialize from base to derived
86 for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) {
87 APICallbackShim callbackShim(exec);
88 JSObjectInitializeCallback initialize = initRoutines[i];
89 initialize(toRef(exec), toRef(this));
90 }
91
92 bool needsFinalizer = false;
93 for (JSClassRef jsClassPtr = classRef(); jsClassPtr && !needsFinalizer; jsClassPtr = jsClassPtr->parentClass)
94 needsFinalizer = jsClassPtr->finalize;
95 if (needsFinalizer) {
96 HandleSlot slot = exec->globalData().allocateGlobalHandle();
97 HandleHeap::heapFor(slot)->makeWeak(slot, m_callbackObjectData.get(), classRef());
98 HandleHeap::heapFor(slot)->writeBarrier(slot, this);
99 *slot = this;
100 }
101}
102
103template <class Base>
104UString JSCallbackObject<Base>::className() const
105{
106 UString thisClassName = classRef()->className();
107 if (!thisClassName.isEmpty())
108 return thisClassName;
109
110 return Base::className();
111}
112
113template <class Base>
114bool JSCallbackObject<Base>::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
115{
116 JSContextRef ctx = toRef(exec);
117 JSObjectRef thisRef = toRef(this);
118 RefPtr<OpaqueJSString> propertyNameRef;
119
120 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
121 // optional optimization to bypass getProperty in cases when we only need to know if the property exists
122 if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) {
123 if (!propertyNameRef)
124 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
125 APICallbackShim callbackShim(exec);
126 if (hasProperty(ctx, thisRef, propertyNameRef.get())) {
127 slot.setCustom(this, callbackGetter);
128 return true;
129 }
130 } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) {
131 if (!propertyNameRef)
132 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
133 JSValueRef exception = 0;
134 JSValueRef value;
135 {
136 APICallbackShim callbackShim(exec);
137 value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception);
138 }
139 if (exception) {
140 throwError(exec, toJS(exec, exception));
141 slot.setValue(jsUndefined());
142 return true;
143 }
144 if (value) {
145 slot.setValue(toJS(exec, value));
146 return true;
147 }
148 }
149
150 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
151 if (staticValues->contains(propertyName.impl())) {
152 JSValue value = getStaticValue(exec, propertyName);
153 if (value) {
154 slot.setValue(value);
155 return true;
156 }
157 }
158 }
159
160 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
161 if (staticFunctions->contains(propertyName.impl())) {
162 slot.setCustom(this, staticFunctionGetter);
163 return true;
164 }
165 }
166 }
167
168 return Base::getOwnPropertySlot(exec, propertyName, slot);
169}
170
171template <class Base>
172bool JSCallbackObject<Base>::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
173{
174 PropertySlot slot;
175 if (getOwnPropertySlot(exec, propertyName, slot)) {
176 // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing.
177 JSValue value = slot.getValue(exec, propertyName);
178 if (!exec->hadException())
179 descriptor.setValue(value);
180 // We don't know whether the property is configurable, but assume it is.
181 descriptor.setConfigurable(true);
182 // We don't know whether the property is enumerable (we could call getOwnPropertyNames() to find out), but assume it isn't.
183 descriptor.setEnumerable(false);
184 return true;
185 }
186
187 return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
188}
189
190template <class Base>
191void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
192{
193 JSContextRef ctx = toRef(exec);
194 JSObjectRef thisRef = toRef(this);
195 RefPtr<OpaqueJSString> propertyNameRef;
196 JSValueRef valueRef = toRef(exec, value);
197
198 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
199 if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) {
200 if (!propertyNameRef)
201 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
202 JSValueRef exception = 0;
203 bool result;
204 {
205 APICallbackShim callbackShim(exec);
206 result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception);
207 }
208 if (exception)
209 throwError(exec, toJS(exec, exception));
210 if (result || exception)
211 return;
212 }
213
214 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
215 if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) {
216 if (entry->attributes & kJSPropertyAttributeReadOnly)
217 return;
218 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) {
219 if (!propertyNameRef)
220 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
221 JSValueRef exception = 0;
222 bool result;
223 {
224 APICallbackShim callbackShim(exec);
225 result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception);
226 }
227 if (exception)
228 throwError(exec, toJS(exec, exception));
229 if (result || exception)
230 return;
231 }
232 }
233 }
234
235 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
236 if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
237 if (entry->attributes & kJSPropertyAttributeReadOnly)
238 return;
239 JSCallbackObject<Base>::putDirect(exec->globalData(), propertyName, value); // put as override property
240 return;
241 }
242 }
243 }
244
245 return Base::put(exec, propertyName, value, slot);
246}
247
248template <class Base>
249bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, const Identifier& propertyName)
250{
251 JSContextRef ctx = toRef(exec);
252 JSObjectRef thisRef = toRef(this);
253 RefPtr<OpaqueJSString> propertyNameRef;
254
255 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
256 if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) {
257 if (!propertyNameRef)
258 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
259 JSValueRef exception = 0;
260 bool result;
261 {
262 APICallbackShim callbackShim(exec);
263 result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception);
264 }
265 if (exception)
266 throwError(exec, toJS(exec, exception));
267 if (result || exception)
268 return true;
269 }
270
271 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
272 if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) {
273 if (entry->attributes & kJSPropertyAttributeDontDelete)
274 return false;
275 return true;
276 }
277 }
278
279 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
280 if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
281 if (entry->attributes & kJSPropertyAttributeDontDelete)
282 return false;
283 return true;
284 }
285 }
286 }
287
288 return Base::deleteProperty(exec, propertyName);
289}
290
291template <class Base>
292bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, unsigned propertyName)
293{
294 return deleteProperty(exec, Identifier::from(exec, propertyName));
295}
296
297template <class Base>
298ConstructType JSCallbackObject<Base>::getConstructData(ConstructData& constructData)
299{
300 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
301 if (jsClass->callAsConstructor) {
302 constructData.native.function = construct;
303 return ConstructTypeHost;
304 }
305 }
306 return ConstructTypeNone;
307}
308
309template <class Base>
310EncodedJSValue JSCallbackObject<Base>::construct(ExecState* exec)
311{
312 JSObject* constructor = exec->callee();
313 JSContextRef execRef = toRef(exec);
314 JSObjectRef constructorRef = toRef(constructor);
315
316 for (JSClassRef jsClass = static_cast<JSCallbackObject<Base>*>(constructor)->classRef(); jsClass; jsClass = jsClass->parentClass) {
317 if (JSObjectCallAsConstructorCallback callAsConstructor = jsClass->callAsConstructor) {
318 int argumentCount = static_cast<int>(exec->argumentCount());
319 Vector<JSValueRef, 16> arguments(argumentCount);
320 for (int i = 0; i < argumentCount; i++)
321 arguments[i] = toRef(exec, exec->argument(i));
322 JSValueRef exception = 0;
323 JSObject* result;
324 {
325 APICallbackShim callbackShim(exec);
326 result = toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), &exception));
327 }
328 if (exception)
329 throwError(exec, toJS(exec, exception));
330 return JSValue::encode(result);
331 }
332 }
333
334 ASSERT_NOT_REACHED(); // getConstructData should prevent us from reaching here
335 return JSValue::encode(JSValue());
336}
337
338template <class Base>
339bool JSCallbackObject<Base>::hasInstance(ExecState* exec, JSValue value, JSValue)
340{
341 JSContextRef execRef = toRef(exec);
342 JSObjectRef thisRef = toRef(this);
343
344 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
345 if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) {
346 JSValueRef valueRef = toRef(exec, value);
347 JSValueRef exception = 0;
348 bool result;
349 {
350 APICallbackShim callbackShim(exec);
351 result = hasInstance(execRef, thisRef, valueRef, &exception);
352 }
353 if (exception)
354 throwError(exec, toJS(exec, exception));
355 return result;
356 }
357 }
358 return false;
359}
360
361template <class Base>
362CallType JSCallbackObject<Base>::getCallData(CallData& callData)
363{
364 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
365 if (jsClass->callAsFunction) {
366 callData.native.function = call;
367 return CallTypeHost;
368 }
369 }
370 return CallTypeNone;
371}
372
373template <class Base>
374EncodedJSValue JSCallbackObject<Base>::call(ExecState* exec)
375{
376 JSContextRef execRef = toRef(exec);
377 JSObjectRef functionRef = toRef(exec->callee());
378 JSObjectRef thisObjRef = toRef(exec->hostThisValue().toThisObject(exec));
379
380 for (JSClassRef jsClass = static_cast<JSCallbackObject<Base>*>(toJS(functionRef))->classRef(); jsClass; jsClass = jsClass->parentClass) {
381 if (JSObjectCallAsFunctionCallback callAsFunction = jsClass->callAsFunction) {
382 int argumentCount = static_cast<int>(exec->argumentCount());
383 Vector<JSValueRef, 16> arguments(argumentCount);
384 for (int i = 0; i < argumentCount; i++)
385 arguments[i] = toRef(exec, exec->argument(i));
386 JSValueRef exception = 0;
387 JSValue result;
388 {
389 APICallbackShim callbackShim(exec);
390 result = toJS(exec, callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception));
391 }
392 if (exception)
393 throwError(exec, toJS(exec, exception));
394 return JSValue::encode(result);
395 }
396 }
397
398 ASSERT_NOT_REACHED(); // getCallData should prevent us from reaching here
399 return JSValue::encode(JSValue());
400}
401
402template <class Base>
403void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
404{
405 JSContextRef execRef = toRef(exec);
406 JSObjectRef thisRef = toRef(this);
407
408 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
409 if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) {
410 APICallbackShim callbackShim(exec);
411 getPropertyNames(execRef, thisRef, toRef(&propertyNames));
412 }
413
414 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
415 typedef OpaqueJSClassStaticValuesTable::const_iterator iterator;
416 iterator end = staticValues->end();
417 for (iterator it = staticValues->begin(); it != end; ++it) {
418 StringImpl* name = it->first.get();
419 StaticValueEntry* entry = it->second;
420 if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)))
421 propertyNames.add(Identifier(exec, name));
422 }
423 }
424
425 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
426 typedef OpaqueJSClassStaticFunctionsTable::const_iterator iterator;
427 iterator end = staticFunctions->end();
428 for (iterator it = staticFunctions->begin(); it != end; ++it) {
429 StringImpl* name = it->first.get();
430 StaticFunctionEntry* entry = it->second;
431 if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))
432 propertyNames.add(Identifier(exec, name));
433 }
434 }
435 }
436
437 Base::getOwnPropertyNames(exec, propertyNames, mode);
438}
439
440template <class Base>
441double JSCallbackObject<Base>::toNumber(ExecState* exec) const
442{
443 // We need this check to guard against the case where this object is rhs of
444 // a binary expression where lhs threw an exception in its conversion to
445 // primitive
446 if (exec->hadException())
447 return NaN;
448 JSContextRef ctx = toRef(exec);
449 JSObjectRef thisRef = toRef(this);
450
451 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass)
452 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) {
453 JSValueRef exception = 0;
454 JSValueRef value;
455 {
456 APICallbackShim callbackShim(exec);
457 value = convertToType(ctx, thisRef, kJSTypeNumber, &exception);
458 }
459 if (exception) {
460 throwError(exec, toJS(exec, exception));
461 return 0;
462 }
463
464 double dValue;
465 if (value)
466 return toJS(exec, value).getNumber(dValue) ? dValue : NaN;
467 }
468
469 return Base::toNumber(exec);
470}
471
472template <class Base>
473UString JSCallbackObject<Base>::toString(ExecState* exec) const
474{
475 JSContextRef ctx = toRef(exec);
476 JSObjectRef thisRef = toRef(this);
477
478 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass)
479 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) {
480 JSValueRef exception = 0;
481 JSValueRef value;
482 {
483 APICallbackShim callbackShim(exec);
484 value = convertToType(ctx, thisRef, kJSTypeString, &exception);
485 }
486 if (exception) {
487 throwError(exec, toJS(exec, exception));
488 return "";
489 }
490 if (value)
491 return toJS(exec, value).getString(exec);
492 }
493
494 return Base::toString(exec);
495}
496
497template <class Base>
498void JSCallbackObject<Base>::setPrivate(void* data)
499{
500 m_callbackObjectData->privateData = data;
501}
502
503template <class Base>
504void* JSCallbackObject<Base>::getPrivate()
505{
506 return m_callbackObjectData->privateData;
507}
508
509template <class Base>
510bool JSCallbackObject<Base>::inherits(JSClassRef c) const
511{
512 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass)
513 if (jsClass == c)
514 return true;
515
516 return false;
517}
518
519template <class Base>
520JSValue JSCallbackObject<Base>::getStaticValue(ExecState* exec, const Identifier& propertyName)
521{
522 JSObjectRef thisRef = toRef(this);
523 RefPtr<OpaqueJSString> propertyNameRef;
524
525 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass)
526 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec))
527 if (StaticValueEntry* entry = staticValues->get(propertyName.impl()))
528 if (JSObjectGetPropertyCallback getProperty = entry->getProperty) {
529 if (!propertyNameRef)
530 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
531 JSValueRef exception = 0;
532 JSValueRef value;
533 {
534 APICallbackShim callbackShim(exec);
535 value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception);
536 }
537 if (exception) {
538 throwError(exec, toJS(exec, exception));
539 return jsUndefined();
540 }
541 if (value)
542 return toJS(exec, value);
543 }
544
545 return JSValue();
546}
547
548template <class Base>
549JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
550{
551 JSCallbackObject* thisObj = asCallbackObject(slotBase);
552
553 // Check for cached or override property.
554 PropertySlot slot2(thisObj);
555 if (thisObj->Base::getOwnPropertySlot(exec, propertyName, slot2))
556 return slot2.getValue(exec, propertyName);
557
558 for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) {
559 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
560 if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
561 if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
562
563 JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);
564 thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes);
565 return o;
566 }
567 }
568 }
569 }
570
571 return throwError(exec, createReferenceError(exec, "Static function property defined with NULL callAsFunction callback."));
572}
573
574template <class Base>
575JSValue JSCallbackObject<Base>::callbackGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
576{
577 JSCallbackObject* thisObj = asCallbackObject(slotBase);
578
579 JSObjectRef thisRef = toRef(thisObj);
580 RefPtr<OpaqueJSString> propertyNameRef;
581
582 for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass)
583 if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) {
584 if (!propertyNameRef)
585 propertyNameRef = OpaqueJSString::create(propertyName.ustring());
586 JSValueRef exception = 0;
587 JSValueRef value;
588 {
589 APICallbackShim callbackShim(exec);
590 value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception);
591 }
592 if (exception) {
593 throwError(exec, toJS(exec, exception));
594 return jsUndefined();
595 }
596 if (value)
597 return toJS(exec, value);
598 }
599
600 return throwError(exec, createReferenceError(exec, "hasProperty callback returned true for a property that doesn't exist."));
601}
602
603} // namespace JSC