3 2005-02-03 Richard Williamson <rjw@apple.com>
5 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
7 Revert to old (and correct) behavior of returning runtime object
8 when passed as a parameter, rather than it's corresponding DOM
13 * bindings/objc/WebScriptObject.mm:
14 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
18 2005-01-28 Richard Williamson <rjw@apple.com>
20 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
22 Only use special 'back door' property to get the runtime object if thisObj isn't
23 already a runtime object.
25 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
26 ClassInfo pointer instead.
30 * bindings/c/c_utility.cpp:
31 (convertValueToNPVariant):
32 * bindings/objc/WebScriptObject.mm:
33 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
34 * bindings/runtime_method.cpp:
35 (RuntimeMethodImp::call):
39 2005-01-26 Richard Williamson <rjw@apple.com>
41 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
43 I added a member variable to ObjectImp. This changed it's size and consequently
44 hampered the optimizations built into the garbage collector. Objects no longer
45 fit within the allocators cell size, and thus allocation fell back to a slower
48 As a result of this fix I also dramatically cleaned up how runtime objects are
49 accessed. The path mostly *removes* code.
53 * bindings/runtime_method.cpp:
54 (RuntimeMethodImp::call):
55 * bindings/runtime_object.cpp:
56 (RuntimeObjectImp::get):
57 (RuntimeObjectImp::put):
58 (RuntimeObjectImp::canPut):
59 (RuntimeObjectImp::hasProperty):
60 (RuntimeObjectImp::defaultValue):
61 * bindings/runtime_object.h:
63 (KJS::ObjectImp::ObjectImp):
66 2005-01-20 Darin Adler <darin@apple.com>
68 Reviewed by me, changes by Han Ming Ong.
70 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
72 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
73 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
75 2005-01-20 Richard Williamson <rjw@apple.com>
77 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
79 The comprehensive fix for this problem requires new API, as described in 3965326. However,
80 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
81 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
82 implemented on the bound object.
86 * bindings/objc/objc_runtime.h:
87 * bindings/objc/objc_runtime.mm:
88 (ObjcFallbackObjectImp::type):
89 (ObjcFallbackObjectImp::implementsCall):
90 (ObjcFallbackObjectImp::toBoolean):
91 * bindings/testbindings.mm:
92 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
93 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
97 2005-01-19 Richard Williamson <rjw@apple.com>
99 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
101 Fixed the following problems with LiveConnect that are demonstrated by the application
102 described in 3853676.
104 1. If a nil object is passed in an array from Java to JavaScript we will crash.
105 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
106 3. We will sometimes fail to find the correct static method ID.
110 * bindings/jni/jni_jsobject.cpp:
111 (JSObject::convertJObjectToValue):
112 (JSObject::listFromJArray):
113 * bindings/jni/jni_runtime.cpp:
114 (JavaField::valueFromInstance):
115 (JavaField::setValueToInstance):
116 * bindings/jni/jni_utility.cpp:
117 (KJS::Bindings::getMethodID):
118 (KJS::Bindings::convertValueToJValue):
119 * bindings/runtime_array.h:
121 2005-01-18 Richard Williamson <rjw@apple.com>
123 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
125 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
126 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
127 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
128 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
130 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
131 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
132 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
136 * bindings/objc/objc_instance.h:
137 * bindings/objc/objc_instance.mm:
138 (ObjcInstance::supportsSetValueOfUndefinedField):
139 * bindings/runtime.h:
140 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
141 * bindings/runtime_object.cpp:
142 (RuntimeObjectImp::RuntimeObjectImp):
143 (RuntimeObjectImp::get):
144 (RuntimeObjectImp::put):
145 (RuntimeObjectImp::canPut):
146 (RuntimeObjectImp::hasProperty):
147 (RuntimeObjectImp::defaultValue):
148 * bindings/runtime_object.h:
149 (KJS::RuntimeObjectImp::fallbackObject):
151 (KJS::ObjectImp::ObjectImp):
153 (KJS::ObjectImp::forwardingScriptMessage):
154 (KJS::ObjectImp::setForwardingScriptMessage):
156 2005-01-18 Richard Williamson <rjw@apple.com>
158 Back out a change that was incorrectly committed yesterday.
162 * bindings/objc/objc_utility.mm:
163 (KJS::Bindings::convertValueToObjcValue):
165 2005-01-17 Richard Williamson <rjw@apple.com>
167 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
169 Keep track of originating execution context and target execution
170 context for native JS object wrappers, and perform appropriate
173 Reviewed by David Harrison.
175 * bindings/NP_jsobject.cpp:
177 (_NPN_CreateScriptObject):
182 (_NPN_RemoveProperty):
186 * bindings/NP_jsobject.h:
187 * bindings/c/c_instance.cpp:
188 (CInstance::CInstance):
189 (CInstance::stringValue):
190 * bindings/c/c_instance.h:
191 * bindings/c/c_utility.cpp:
192 (convertValueToNPVariant):
193 * bindings/jni/jni_instance.cpp:
194 (JavaInstance::JavaInstance):
195 (JavaInstance::valueOf):
196 * bindings/jni/jni_instance.h:
197 * bindings/objc/WebScriptObject.mm:
198 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
199 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
200 (-[WebScriptObject KJS::Bindings::]):
201 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
202 (-[WebScriptObject _isSafeScript]):
203 (-[WebScriptObject callWebScriptMethod:withArguments:]):
204 (-[WebScriptObject evaluateWebScript:]):
205 (-[WebScriptObject setValue:forKey:]):
206 (-[WebScriptObject valueForKey:]):
207 (-[WebScriptObject removeWebScriptKey:]):
208 (-[WebScriptObject stringRepresentation]):
209 (-[WebScriptObject webScriptValueAtIndex:]):
210 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
211 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
212 * bindings/objc/WebScriptObjectPrivate.h:
213 * bindings/objc/objc_instance.h:
214 * bindings/objc/objc_runtime.mm:
215 (convertValueToObjcObject):
216 * bindings/objc/objc_utility.mm:
217 (KJS::Bindings::convertValueToObjcValue):
218 * bindings/runtime.cpp:
219 (Instance::Instance):
220 (Instance::operator=):
221 * bindings/runtime.h:
222 (KJS::Bindings::Instance::Instance):
223 (KJS::Bindings::Instance::setExecutionContext):
224 (KJS::Bindings::Instance::executionContext):
225 * bindings/runtime_root.cpp:
226 (RootObject::setInterpreter):
227 * bindings/runtime_root.h:
229 (KJS::Interpreter::isGlobalObject):
230 (KJS::Interpreter::interpreterForGlobalObject):
231 (KJS::Interpreter::isSafeScript):
235 2005-01-13 Vicki Murley <vicki@apple.com>
239 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
241 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
243 2005-01-12 Richard Williamson <rjw@apple.com>
245 Avoid additional work on dealloc by adding early out to
246 removeNativeReference(). (This will save time on dealloc
247 for all ObjC DOM objects.)
251 * bindings/runtime_root.cpp:
252 (KJS::Bindings::removeNativeReference):
254 2005-01-12 Richard Williamson <rjw@apple.com>
256 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
258 We were always returning the first "root" object for all runtime
259 objects. Changed 0 in loop to i, the index.
261 Reviewed by David Harrison.
263 * bindings/runtime_root.cpp:
264 (KJS::Bindings::rootForImp):
266 2005-01-11 Richard Williamson <rjw@apple.com>
268 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
270 Use the new dispatching API to invoke JNI, rather than calling JNI
273 Reviewed by David Harrison.
275 * bindings/jni/jni_instance.cpp:
276 (JavaInstance::invokeMethod):
277 * bindings/jni/jni_runtime.cpp:
278 (JavaField::dispatchValueFromInstance):
279 (JavaField::valueFromInstance):
280 (JavaField::dispatchSetValueToInstance):
281 (JavaField::setValueToInstance):
282 * bindings/jni/jni_runtime.h:
283 * bindings/jni/jni_utility.cpp:
284 (KJS::Bindings::convertValueToJValue):
292 2004-12-17 Maciej Stachowiak <mjs@apple.com>
296 <rdar://problem/3926869> Opening caches window after running PLT causes crash
298 * kjs/protected_values.cpp:
299 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
300 the protected value table.
301 (KJS::ProtectedValues::increaseProtectCount): Ditto.
302 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
304 2004-12-16 Darin Adler <darin@apple.com>
308 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
310 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
311 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
312 non-locale-specific versions.
313 * kjs/string_object.lut.h: Regenerated.
315 2004-12-14 Richard Williamson <rjw@apple.com>
317 Pass URL of plugin view when call into JNI.
321 * bindings/jni/jni_objc.mm:
322 (KJS::Bindings::dispatchJNICall):
324 2004-12-13 Richard Williamson <rjw@apple.com>
326 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
328 Add support for calling static Java methods from JavaScript.
332 * bindings/jni/jni_instance.cpp:
333 (JavaInstance::invokeMethod):
334 * bindings/jni/jni_runtime.cpp:
335 (JavaMethod::JavaMethod):
336 * bindings/jni/jni_runtime.h:
337 (KJS::Bindings::JavaMethod::isStatic):
338 * bindings/jni/jni_utility.cpp:
339 (callJNIStaticMethod):
340 (KJS::Bindings::callJNIBooleanMethod):
341 (KJS::Bindings::callJNIStaticBooleanMethod):
342 * bindings/jni/jni_utility.h:
344 2004-12-13 Richard Williamson <rjw@apple.com>
346 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
350 * bindings/jni/jni_instance.cpp:
351 (JavaInstance::invokeMethod):
352 * bindings/jni/jni_objc.mm:
353 (KJS::Bindings::dispatchJNICall):
354 * bindings/jni/jni_runtime.h:
355 * bindings/jni/jni_utility.h:
359 2004-12-07 Maciej Stachowiak <mjs@apple.com>
363 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
365 The fix was to implement copy constructor and assignment operator,
366 the ones that worked on the base class did not replace the
370 (KJS::ProtectedValue::ProtectedValue):
371 (KJS::ProtectedValue::operator=):
372 (KJS::ProtectedObject::ProtectedObject):
373 (KJS::ProtectedObject::operator=):
375 Also fixed a bug in the GC test mode that compares the results of
376 the old collector and the new collector.
383 2004-11-23 Richard Williamson <rjw@apple.com>
385 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
389 * bindings/c/c_class.cpp:
390 (CClass::_commonInit):
392 2004-11-21 Maciej Stachowiak <mjs@apple.com>
396 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
399 (KJS::Collector::Thread::Thread):
400 (KJS::destroyRegisteredThread):
401 (KJS::initializeRegisteredThreadKey):
402 (KJS::Collector::registerThread):
403 (KJS::Collector::markStackObjectsConservatively):
404 (KJS::Collector::markCurrentThreadConservatively):
405 (KJS::Collector::markOtherThreadConservatively):
413 2004-11-15 Richard Williamson <rjw@apple.com>
415 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
419 * bindings/objc/objc_instance.mm:
420 (ObjcInstance::stringValue):
421 * bindings/objc/objc_utility.h:
422 * bindings/objc/objc_utility.mm:
423 (KJS::Bindings::convertNSStringToString):
424 (KJS::Bindings::convertObjcValueToValue):
428 2004-11-09 Chris Blumenberg <cblu@apple.com>
430 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
435 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
436 * bindings/softlinking.c: Added.
438 (getFunctionPointer): new
439 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
443 2004-11-04 Darin Adler <darin@apple.com>
447 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
448 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
449 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
450 than allocating a new one
452 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
453 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
454 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
455 actually allocate only the very first time it's called.
456 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
457 shared instance since there can be only one).
458 (-[WebUndefined copyWithZone:]): Ditto.
459 (-[WebUndefined retain]): Ditto.
460 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
462 (-[WebUndefined autorelease]): Simplified to just return self (see above).
463 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
464 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
465 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
466 bug mentioned above).
467 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
468 No need to call init, since that's a no-op for this class.
470 2004-11-03 David Harrison <harrison@apple.com>
474 Eliminate the use of a marker file to determine how to build.
479 2004-11-01 Richard Williamson <rjw@apple.com>
481 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
485 * bindings/c/c_instance.cpp:
486 (CInstance::invokeMethod):
487 (CInstance::invokeDefaultMethod):
488 Initialize out parameters to void type.
490 * bindings/c/c_runtime.cpp:
491 (CField::valueFromInstance):
492 (CField::setValueToInstance):
493 Initialize out parameters to void type.
494 Also added additional checks to protect against classes that
495 don't implement all functions.
497 2004-11-01 Richard Williamson <rjw@apple.com>
499 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
504 * bindings/objc/WebScriptObject.mm:
505 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
506 Added additional conversion Undefined -> WebUndefined.
507 * bindings/objc/objc_utility.mm:
508 (KJS::Bindings::convertObjcValueToValue):
509 Added additional conversion WebUndefined -> Undefined.
511 2004-11-01 Darin Adler <darin@apple.com>
513 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
515 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
516 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
517 report to match the contents of the file.
523 2004-10-22 Ken Kocienda <kocienda@apple.com>
527 * JavaScriptCore.pbproj/project.pbxproj:
528 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
532 2004-10-13 Richard Williamson <rjw@apple.com>
534 Moved boolean checks prior to NSNumber checks. booleans are
537 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
541 * bindings/objc/objc_utility.mm:
542 (KJS::Bindings::convertObjcValueToValue):
544 2004-10-12 Richard Williamson <rjw@apple.com>
546 Fixed access to DOM object via WebScriptObject API.
547 The execution context for DOM objects wasn't being found.
548 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
552 * bindings/objc/WebScriptObject.mm:
554 (-[WebScriptObject KJS::Bindings::]):
555 (-[WebScriptObject callWebScriptMethod:withArguments:]):
556 (-[WebScriptObject evaluateWebScript:]):
557 (-[WebScriptObject setValue:forKey:]):
558 (-[WebScriptObject valueForKey:]):
559 (-[WebScriptObject stringRepresentation]):
560 * bindings/objc/WebScriptObjectPrivate.h:
562 2004-10-09 Darin Adler <darin@apple.com>
566 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
568 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
569 creating an init routine.
571 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
572 require a global constructor that creates an init routine.
574 2004-10-09 Darin Adler <darin@apple.com>
578 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
580 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
581 work with the window object of the page the function is in, not the page of the caller. This
582 is what all other browsers do. This code was hidden before by the "everything is defined on
583 window object" hack in WebCore.
585 2004-10-07 Richard Williamson <rjw@apple.com>
587 Added simple JavaScript call tracing. Very useful for
588 debugging complex pages.
590 Tracing is only available in development builds and is
593 (gdb) set traceJavaScript = 1
597 setTraceJavaScript(true)
599 Function, args, and return values are printed to console. Very
604 * kjs/function_object.cpp:
605 (FunctionProtoFuncImp::call):
611 2004-10-05 Richard Williamson <rjw@apple.com>
613 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
617 * bindings/NP_jsobject.cpp:
619 * bindings/npruntime.cpp:
620 (_NPN_SetExceptionWithUTF8):
621 * bindings/objc/WebScriptObject.mm:
622 (+[WebScriptObject throwException:]):
624 (KJS::InterpreterImp::context):
626 2004-10-05 Richard Williamson <rjw@apple.com>
628 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
632 * bindings/objc/objc_utility.mm:
633 (KJS::Bindings::convertObjcValueToValue):
635 2004-10-04 Darin Adler <darin@apple.com>
639 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
641 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
643 - rolled out an old workaround we don't need any more
645 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
646 required it is no longer there.
648 2004-09-30 Richard Williamson <rjw@apple.com>
650 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
654 * bindings/NP_jsobject.cpp:
658 * bindings/c/c_class.cpp:
659 (CClass::methodsNamed):
660 (CClass::fieldNamed):
661 * bindings/c/c_class.h:
662 * bindings/c/c_instance.cpp:
663 (CInstance::invokeMethod):
664 * bindings/jni/jni_class.cpp:
665 (JavaClass::methodsNamed):
666 * bindings/jni/jni_class.h:
667 * bindings/npruntime.h:
668 * bindings/objc/objc_class.h:
669 * bindings/objc/objc_class.mm:
670 (ObjcClass::methodsNamed):
671 * bindings/runtime.h:
672 * bindings/runtime_object.cpp:
673 (RuntimeObjectImp::get):
674 (RuntimeObjectImp::hasProperty):
676 2004-09-29 Chris Blumenberg <cblu@apple.com>
678 Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
682 * JavaScriptCore.pbproj/project.pbxproj:
683 * bindings/NP_jsobject.cpp:
684 (_NPN_CreateScriptObject):
685 (_NPN_InvokeDefault):
690 (_NPN_RemoveProperty):
693 * bindings/c/c_class.cpp:
694 (CClass::methodsNamed):
695 (CClass::fieldNamed):
696 * bindings/c/c_instance.cpp:
697 (CInstance::CInstance):
698 (CInstance::~CInstance):
699 (CInstance::operator=):
700 (CInstance::invokeMethod):
701 (CInstance::invokeDefaultMethod):
702 * bindings/c/c_runtime.cpp:
703 * bindings/c/c_runtime.h:
704 (KJS::Bindings::CField::name):
705 (KJS::Bindings::CMethod::name):
706 * bindings/npruntime.cpp:
707 (_NPN_GetStringIdentifier):
708 (_NPN_GetStringIdentifiers):
709 (_NPN_GetIntIdentifier):
710 (_NPN_IdentifierIsString):
711 (_NPN_UTF8FromIdentifier):
712 (_NPN_IntFromIdentifier):
713 (NPN_InitializeVariantWithObject):
714 (_NPN_ReleaseVariantValue):
717 (_NPN_ReleaseObject):
718 (_NPN_SetExceptionWithUTF8):
721 2004-09-26 Darin Adler <darin@apple.com>
723 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
724 low() to get Unicode value of character, and just use unicode().
726 2004-09-26 Darin Adler <darin@apple.com>
728 - refine charAt/charCodeAt fix slightly
730 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
731 omitted parameter, as we do everywhere else, and as other browsers do here.
733 2004-09-26 Darin Adler <darin@apple.com>
737 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
739 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
740 the program. We were doing this properly for functions, but not entire programs.
742 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
744 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
745 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
747 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
753 2004-09-14 Richard Williamson <rjw@apple.com>
755 1. Add class parameter to object allocation function. This is somewhat redundant, given that
756 the allocation function is in the class function vector, but people wanted to use the same
757 allocation function for different classes.
759 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
761 3. Add support for a default function on an object. This is a feature that ActiveX supports,
762 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
763 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
764 'Objective-C' bindings.
766 There bugs are covered by
768 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
769 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
770 <rdar://problem/3674754> Need to implement latest npruntime.h
774 * bindings/NP_jsobject.cpp:
778 * bindings/c/c_class.cpp:
779 * bindings/c/c_instance.cpp:
780 (CInstance::CInstance):
781 (CInstance::operator=):
782 (CInstance::invokeMethod):
783 (CInstance::invokeDefaultMethod):
784 * bindings/c/c_instance.h:
785 * bindings/c/c_runtime.cpp:
786 * bindings/c/c_runtime.h:
787 * bindings/jni/jni_instance.cpp:
788 (JavaInstance::invokeDefaultMethod):
789 * bindings/jni/jni_instance.h:
790 * bindings/npruntime.cpp:
792 * bindings/npruntime.h:
793 * bindings/objc/WebScriptObject.h:
794 * bindings/objc/objc_class.mm:
795 (ObjcClass::fallbackObject):
796 * bindings/objc/objc_instance.h:
797 * bindings/objc/objc_instance.mm:
798 (ObjcInstance::invokeDefaultMethod):
799 * bindings/objc/objc_runtime.h:
800 * bindings/objc/objc_runtime.mm:
801 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
802 (ObjcFallbackObjectImp::get):
803 (ObjcFallbackObjectImp::put):
804 (ObjcFallbackObjectImp::canPut):
805 (ObjcFallbackObjectImp::implementsCall):
806 (ObjcFallbackObjectImp::call):
807 (ObjcFallbackObjectImp::hasProperty):
808 (ObjcFallbackObjectImp::deleteProperty):
809 (ObjcFallbackObjectImp::defaultValue):
810 * bindings/runtime.h:
811 (KJS::Bindings::Class::fallbackObject):
812 (KJS::Bindings::Instance::getValueOfUndefinedField):
813 (KJS::Bindings::Instance::setValueOfUndefinedField):
814 (KJS::Bindings::Instance::valueOf):
815 * bindings/runtime_object.cpp:
816 (RuntimeObjectImp::implementsCall):
817 (RuntimeObjectImp::call):
818 * bindings/runtime_object.h:
820 2004-09-13 Maciej Stachowiak <mjs@apple.com>
824 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
826 * kjs/string_object.cpp:
827 (StringProtoFuncImp::call): Replaced implementation of replace()
828 method with function below...
829 (replace): In order to avoid excessive allocation and copying,
830 figure out the ranges of the original string and replacement
831 strings to be assembled, instead of constantly creating new
832 strings at each substitution. The old behavior is basically O(N^2)
833 for a global replace on a pattern that matches many places in the
835 (regExpIsGlobal): Helper function for the above.
836 (expandSourceRanges): ditto
837 (pushSourceRange): ditto
838 (expandReplacements): ditto
839 (pushReplacement): ditto
841 (KJS::UString::spliceSubstringsWithSeparators): New method that
842 pieces together substring ranges of this string together with
843 specified separators, all at one go.
845 (KJS::UString::Range::Range): Added new helper class to represent
848 2004-09-14 Maciej Stachowiak <mjs@apple.com>
852 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
855 (KJS::GlobalFuncImp::call): Make sure to escape null
856 characters. This is a bug in the new code that made part of the
859 2004-09-13 Darin Adler <darin@apple.com>
861 Reviewed by Kevin and Maciej.
863 - new function to support fix for DIG bug in WebCore
865 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
866 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
868 2004-09-12 Darin Adler <darin@apple.com>
870 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
871 of escape and unescape.
873 2004-09-12 Darin Adler <darin@apple.com>
877 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
879 * kjs/date_object.cpp:
880 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
881 uses CFDateFormatter.
882 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
884 2004-09-09 Maciej Stachowiak <mjs@apple.com>
888 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
891 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
892 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
894 (Lexer::isHexDigit): Made static and non-const.
899 2004-09-06 Darin Adler <darin@apple.com>
901 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
905 2004-09-01 Richard Williamson <rjw@apple.com>
907 Add pid to exception messages (to help debug dashboard clients).
911 * kjs/interpreter.cpp:
912 (Interpreter::evaluate):
916 2004-08-20 Richard Williamson <rjw@apple.com>
918 Implemented new JNI abstraction. We no longer invoke Java methods
919 directly with JNI, rather we call into the plugin. This allows the
920 plugin to dispatch the call to the appropriate VM thread. This
921 change should (will?) fix a whole class of threading related problems with
926 * JavaScriptCore.pbproj/project.pbxproj:
927 * bindings/c/c_instance.h:
928 (KJS::Bindings::CInstance::setExecutionContext):
929 (KJS::Bindings::CInstance::executionContext):
930 * bindings/jni/jni_instance.cpp:
931 (JavaInstance::JavaInstance):
932 (JavaInstance::invokeMethod):
933 (JavaInstance::setExecutionContext):
934 (JavaInstance::executionContext):
935 * bindings/jni/jni_instance.h:
936 * bindings/jni/jni_jsobject.cpp:
937 (JSObject::convertJObjectToValue):
938 * bindings/jni/jni_runtime.cpp:
939 (JavaField::JavaField):
940 (JavaArray::convertJObjectToArray):
941 (JavaField::valueFromInstance):
942 (JavaArray::JavaArray):
943 (JavaArray::valueAt):
944 * bindings/jni/jni_runtime.h:
945 (KJS::Bindings::JavaArray::operator=):
946 (KJS::Bindings::JavaArray::executionContext):
947 * bindings/jni/jni_utility.h:
948 * bindings/objc/objc_instance.h:
949 (KJS::Bindings::ObjcInstance::setExecutionContext):
950 (KJS::Bindings::ObjcInstance::executionContext):
951 * bindings/runtime.cpp:
952 (Instance::createBindingForLanguageInstance):
953 * bindings/runtime.h:
954 * bindings/runtime_root.h:
955 (KJS::Bindings::RootObject::nativeHandle):
959 2004-08-19 Vicki Murley <vicki@apple.com>
963 * kjs/property_map.cpp:
964 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
966 2004-08-17 Darin Adler <darin@apple.com>
970 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
972 * kjs/property_map.h: Added some private functions.
973 * kjs/property_map.cpp:
974 (KJS::PropertyMap::clear): Set sentinelCount to 0.
975 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
976 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
977 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
978 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
979 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
980 deleted-element sentinels.
981 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
983 2004-08-16 Maciej Stachowiak <mjs@apple.com>
985 Code change by Eric Albert, reviewd by me.
987 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
989 * kjs/date_object.cpp:
990 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
991 entirely would be even better, but is not required to fix this bug.
995 2004-08-16 Richard Williamson <rjw@apple.com>
997 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
999 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1003 * bindings/NP_jsobject.cpp:
1005 * bindings/jni/jni_jsobject.cpp:
1007 * bindings/objc/WebScriptObject.mm:
1008 (-[WebScriptObject evaluateWebScript:]):
1010 2004-08-15 Richard Williamson <rjw@apple.com>
1012 More updates to np headers. Implemented new NPN functions.
1016 * bindings/NP_jsobject.cpp:
1020 * bindings/npruntime.h:
1022 2004-08-13 Darin Adler <darin@apple.com>
1024 - fix build so we can compile again
1026 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1027 is good enough so that we can compile, but it's only a stopgap measure, because I think
1028 Richard has a newer one he wants to check in.
1030 2004-08-12 Richard Williamson <rjw@apple.com>
1032 Bring npruntime.h and friends closer to compliance with
1037 * JavaScriptCore.pbproj/project.pbxproj:
1038 * bindings/NP_jsobject.cpp:
1040 (_NPN_CreateScriptObject):
1045 (NPN_RemoveProperty):
1046 * bindings/NP_jsobject.h:
1047 * bindings/c/c_instance.cpp:
1048 (CInstance::invokeMethod):
1049 * bindings/c/c_utility.cpp:
1050 (convertNPVariantToValue):
1051 * bindings/npruntime.cpp:
1052 (NPN_IdentifierIsString):
1053 (NPN_VariantIsVoid):
1054 (NPN_VariantIsNull):
1055 (NPN_VariantIsUndefined):
1056 (NPN_VariantIsBool):
1057 (NPN_VariantIsInt32):
1058 (NPN_VariantIsDouble):
1059 (NPN_VariantIsString):
1060 (NPN_VariantIsObject):
1061 (NPN_VariantToBool):
1062 (NPN_VariantToString):
1063 (NPN_VariantToInt32):
1064 (NPN_VariantToDouble):
1065 (NPN_VariantToObject):
1066 (NPN_InitializeVariantAsVoid):
1067 (NPN_InitializeVariantAsNull):
1068 (NPN_InitializeVariantAsUndefined):
1069 (NPN_InitializeVariantWithBool):
1070 (NPN_InitializeVariantWithInt32):
1071 (NPN_InitializeVariantWithDouble):
1072 (NPN_InitializeVariantWithString):
1073 (NPN_InitializeVariantWithStringCopy):
1074 (NPN_InitializeVariantWithObject):
1075 (NPN_InitializeVariantWithVariant):
1076 (NPN_ReleaseVariantValue):
1078 * bindings/npruntime.h:
1080 (_NPString::_NPVariant::):
1081 * bindings/npruntime_priv.h: Added.
1083 2004-08-12 Darin Adler <darin@apple.com>
1087 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1090 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1091 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1092 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1093 to skip leading "+" or "-".
1097 2004-08-12 Darin Adler <darin@apple.com>
1101 - fixed 43 Mozilla JavaScript tests
1103 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1104 * kjs/date_object.cpp:
1105 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1106 than constructing a number object to pass to it.
1107 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1108 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1109 (KJS::timeClip): Implement this as specified in the language standard.
1111 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1112 flags on the prototype property.
1115 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1117 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1119 (KJS::parseDigit): Added. Helper function for parseInt.
1120 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1121 strtoll can handle. Also matches standard more closely.
1122 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1124 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1126 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1128 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1130 (Lexer::setCode): Clear error state.
1131 (Lexer::lex): Set error state if the lexer encounters an error
1134 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1135 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1137 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1138 Change round to round values between -0.5 and -0 to -0 instead of +0.
1140 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1141 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1142 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1143 would change x.y into a value that can't be deleted as a side effect.
1145 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1148 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1149 get rid of the fixed size limit for code.
1151 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1152 returns the string without creating a new Rep, since I'm using substr in a place where it will
1153 often be passed a 0.
1155 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1156 the other day that was making a couple tests fail.
1157 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1158 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1159 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1160 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1161 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1163 * kjs/string_object.lut.h: Regenerated.
1165 2004-08-11 Darin Adler <darin@apple.com>
1167 - fixed a tiny problem with the UTF-16 PCRE check-in
1169 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1170 the ctype_meta flag to get set in items that should not have it.
1172 * pcre/chartables.c: Regenerated.
1174 2004-08-10 Richard Williamson <rjw@apple.com>
1176 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1178 The following WebScripting methods are now supported on bound
1181 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1182 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1183 - (id)valueForUndefinedKey:(NSString *)key
1187 * bindings/c/c_class.cpp:
1188 (CClass::fieldNamed):
1189 * bindings/c/c_class.h:
1190 * bindings/jni/jni_class.cpp:
1191 (JavaClass::fieldNamed):
1192 * bindings/jni/jni_class.h:
1193 * bindings/objc/objc_class.h:
1194 (KJS::Bindings::ObjcClass::isa):
1195 * bindings/objc/objc_class.mm:
1196 (ObjcClass::methodsNamed):
1197 (ObjcClass::fieldNamed):
1198 (ObjcClass::fallbackObject):
1199 * bindings/objc/objc_instance.h:
1200 * bindings/objc/objc_instance.mm:
1201 (ObjcInstance::invokeMethod):
1202 (ObjcInstance::setValueOfField):
1203 (ObjcInstance::setValueOfUndefinedField):
1204 (ObjcInstance::getValueOfField):
1205 (ObjcInstance::getValueOfUndefinedField):
1206 * bindings/objc/objc_runtime.h:
1207 (KJS::Bindings::ObjcField::~ObjcField):
1208 (KJS::Bindings::ObjcField::ObjcField):
1209 (KJS::Bindings::ObjcField::operator=):
1210 (KJS::Bindings::FallbackObjectImp::classInfo):
1211 * bindings/objc/objc_runtime.mm:
1212 (ObjcField::ObjcField):
1215 (ObjcField::valueFromInstance):
1216 (ObjcField::setValueToInstance):
1217 (FallbackObjectImp::FallbackObjectImp):
1218 (FallbackObjectImp::get):
1219 (FallbackObjectImp::put):
1220 (FallbackObjectImp::canPut):
1221 (FallbackObjectImp::implementsCall):
1222 (FallbackObjectImp::call):
1223 (FallbackObjectImp::hasProperty):
1224 (FallbackObjectImp::deleteProperty):
1225 (FallbackObjectImp::defaultValue):
1226 * bindings/runtime.h:
1227 (KJS::Bindings::Class::fallbackObject):
1228 (KJS::Bindings::Instance::getValueOfUndefinedField):
1229 (KJS::Bindings::Instance::setValueOfUndefinedField):
1230 * bindings/runtime_object.cpp:
1231 (RuntimeObjectImp::get):
1232 (RuntimeObjectImp::put):
1233 (RuntimeObjectImp::canPut):
1234 (RuntimeObjectImp::hasProperty):
1235 * bindings/testbindings.mm:
1236 (-[MyFirstInterface valueForUndefinedKey:]):
1237 (-[MyFirstInterface setValue:forUndefinedKey:]):
1239 2004-08-10 Darin Adler <darin@apple.com>
1243 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1245 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1246 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1247 that need to use it.
1248 * pcre/pcre.c: Add UTF-16 support to all functions.
1249 * pcre/study.c: Ditto.
1251 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1252 the mode. Changed declarations to use symbolic constants and typedefs so we size
1253 things to ichar when needed.
1255 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1256 sized to 16-bit characters instead of 8-bit.
1259 (pcre_copy_substring): Use pcre_char instead of char.
1260 (pcre_get_substring_list): Ditto.
1261 (pcre_free_substring_list): Ditto.
1262 (pcre_get_substring): Ditto.
1263 (pcre_free_substring): Ditto.
1265 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1266 of hard-coding 8-bit table sizes.
1268 * pcre/chartables.c: Regenerated.
1270 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1271 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1272 is not null. The null string still has a null pointer. This prevents us from
1273 passing a null through to the regular expression engine (which results in a null
1274 error even when the string length is 0).
1277 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1278 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1280 2004-08-09 Darin Adler <darin@apple.com>
1284 - fixed 28 Mozilla JavaScript tests
1286 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1287 checking the number of arguments for the join method.
1289 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1290 than integers, so we aren't limited to 32 bits.
1292 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1293 the implementation of the pow operation. Also simplied a case that was handling positive
1294 and negative infinity separately.
1296 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1297 putting them in a long, so that unsigned shift will work properly.
1299 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1301 * kjs/operations.cpp:
1302 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1303 sign of isinf; our isinf function returns +1 even for negative infinity.
1304 (KJS::isNegInf): And again.
1305 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1306 Our floating point already handles the various infinity cases correctly.
1308 * kjs/regexp_object.cpp:
1309 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1310 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1311 array in cases where we did not match.
1312 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1313 "global", "ignoreCase", "multiline", and "source".
1315 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1316 string into undefined rather than an empty string. For the slice method, handle an
1317 undefined parameter for the limit properly as decribed in the specification, and add
1318 the limit to one case that didn't have the limit at all. For the methods that generate
1319 HTML strings, use lowercase tags instead of uppercase.
1322 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1323 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1324 (KJS::UString::append): Fix some math that caused a buffer overflow.
1325 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1326 flag) rather than converting them all to 0.
1327 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1329 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1331 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1332 the Unicode specification in a few cases where it was wrong before.
1333 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1334 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1335 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1336 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1337 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1338 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1339 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1340 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1341 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1343 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1345 * kjs/number_object.lut.h: Regenerated.
1347 2004-08-09 Darin Adler <darin@apple.com>
1351 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1353 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1354 we get a buffer overflow.
1358 2004-08-05 Richard Williamson <rjw@apple.com>
1360 Fixed part of 3674747. The QT guys need this for feature freeze.
1362 This patch implements support for the
1364 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1366 method of objects bound to JavaScript.
1371 * bindings/objc/objc_class.mm:
1372 (ObjcClass::methodsNamed):
1373 (ObjcClass::fieldNamed):
1374 * bindings/objc/objc_instance.mm:
1375 (ObjcInstance::invokeMethod):
1376 * bindings/objc/objc_runtime.h:
1377 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1378 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1379 (KJS::Bindings::ObjcMethod::javaScriptName):
1380 * bindings/objc/objc_runtime.mm:
1381 (ObjcMethod::ObjcMethod):
1382 (ObjcMethod::getMethodSignature):
1383 (ObjcMethod::setJavaScriptName):
1384 * bindings/testbindings.mm:
1386 2004-08-04 Vicki Murley <vicki@apple.com>
1390 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1393 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1394 go to the next line and continue parsing the string (instead of failing). This matches
1395 behavior in Mac IE and Mozilla.
1397 2004-08-03 Kevin Decker <kdecker@apple.com>
1401 Rolled in changes from the latest KJS sources that support additional
1402 Number.prototype functions.
1404 Specifically this patch covers the follow parts of the ECMA 3 spec:
1405 15.7.4.5, 15.7.4.6, and 15.7.4.7
1408 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1409 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1410 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1412 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1413 list of supported identifiers (a macro).
1414 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1415 and toExponential().
1416 (NumberPrototypeImp::NumberPrototypeImp):
1417 (NumberProtoFuncImp::call):
1418 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1420 (KJS::NumberProtoFuncImp::):
1421 * tests/mozilla/expected.html: Update results.
1423 2004-08-03 Darin Adler <darin@apple.com>
1427 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1429 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1430 we are supposed to just copy the regular expression object, and do so.
1431 Also tighten up arguments check to handle case where an actual "undefined"
1432 is passed rather than just omitting an argument.
1434 * tests/mozilla/expected.html: Update results.
1436 2004-08-02 Darin Adler <darin@apple.com>
1438 * tests/mozilla/.cvsignore: Added.
1439 * tests/mozilla/expected.html: Update results.
1441 2004-08-02 Darin Adler <darin@apple.com>
1445 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1447 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1448 Append the flags here so more tests paseed.
1450 2004-08-02 Darin Adler <darin@apple.com>
1454 - fixed a couple things making 5 Mozilla regexp tests pass
1456 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1458 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1459 be used as the flags string when no parameter was passed.
1461 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1462 Added a class info object for RegExp prototype so it can return
1463 a string instead of raising an exception when converting to a string.
1465 * tests/mozilla/expected.html: Update results.
1467 2004-08-02 Darin Adler <darin@apple.com>
1471 - fix crashes in mozilla tests due to mishandling NaN
1473 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1474 calls to toInteger so that NaN will get turned into something that fits in an integer.
1475 These were the ones John already fixed, but his fix used isnan and the new fix is
1478 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1479 after a call to toInteger to handle NaN properly. Also removed separate check
1480 for undefined that's not needed.
1482 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1483 as in the above two files, but for a lot more functions. Also changed one place with
1484 an explicit check for undefined to instead just check isNaN.
1486 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1487 like me who don't keep $SYMROOTS in their $PATH.
1493 2004-07-26 Kevin Decker <kdecker@apple.com>
1495 Changes done by Darin, reviewed by Kevin.
1497 - changed testkjs to build in Xcode rather than from Makefile
1499 * .cvsignore: Removed obsolete files from this list.
1500 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1501 Changed to build target "All" rather than default target. This makes us
1502 build the testkjs test tool.
1503 * dummy.cpp: Removed.
1504 * kjs/.cvsignore: Removed obsolete files from this list, including
1505 the testkjs tool, which is now built in the symroots directory.
1506 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1507 changed this file. Also this has the nice side effect of causing the tool
1508 to be rebuilt in the new location even if there are no other changes in
1509 your tree when you check this out.
1510 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1511 without setting the execute bit on jsDriver.pl.
1513 2004-07-22 Kevin Decker <kdecker@apple.com>
1517 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1519 * kjs/function_object.cpp:
1520 (FunctionObjectImp::construct):
1521 * kjs/function_object.h:
1523 (KJS::ObjectImp::construct):
1525 (KJS::Object::construct):
1527 2004-07-21 Darin Adler <darin@apple.com>
1529 * bindings/npruntime.h: Fixed typo.
1531 2004-07-19 John Sullivan <sullivan@apple.com>
1535 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1536 vulnerability in my patch for 3714644
1538 * kjs/array_object.cpp:
1539 (ArrayProtoFuncImp::call):
1540 handle NAN parameters passed to slice() by clamping to 0 and length.
1542 2004-07-19 Richard Williamson <rjw@apple.com>
1544 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1549 * bindings/jni/jni_jsobject.cpp:
1551 (JSObject::JSObject):
1553 2004-07-16 John Sullivan <sullivan@apple.com>
1557 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1558 hangs browser with javascript
1560 * kjs/array_object.cpp:
1561 (ArrayProtoFuncImp::call):
1562 Check for undefined type for args[0] the same way we were already checking
1563 for args[1]. In this case, args was zero-length, but we were treating
1564 args[0] like an integer anyway. Resulted in some code looping from a NAN
1565 value to 4, taking approximately forever.
1567 * JavaScriptCore.pbproj/project.pbxproj:
1572 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1576 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1577 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1579 * kjs/number_object.cpp:
1580 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1582 2004-07-13 Kevin Decker <kdecker@apple.com>
1584 Reviewed by kocienda.
1586 - made testkjs and JavaScriptCore a subtarget of 'All'
1587 - testkjs now builds in $SYMROOTS
1589 * JavaScriptCore.pbproj/project.pbxproj:
1593 2004-06-24 Chris Blumenberg <cblu@apple.com>
1595 Ignore .mode1 files in JavaScriptCore.pbproj
1597 Reviewed by kocienda.
1599 * JavaScriptCore.pbproj/.cvsignore:
1601 2004-06-23 Richard Williamson <rjw@apple.com>
1603 Implemented changes for latest npruntime.h.
1607 * JavaScriptCore.pbproj/project.pbxproj:
1608 * bindings/NP_jsobject.cpp:
1609 (listFromVariantArgs):
1610 (identiferFromNPIdentifier):
1611 (_NPN_CreateScriptObject):
1616 (NPN_RemoveProperty):
1617 * bindings/NP_jsobject.h:
1618 * bindings/c/c_class.cpp:
1619 (CClass::methodsNamed):
1620 (CClass::fieldNamed):
1621 * bindings/c/c_instance.cpp:
1622 (CInstance::invokeMethod):
1623 * bindings/c/c_utility.cpp:
1624 (convertNPVariantToValue):
1625 * bindings/c/c_utility.h:
1626 * bindings/npruntime.cpp:
1627 (stringIdentifierEqual):
1628 (stringIdentifierHash):
1629 (getStringIdentifierDictionary):
1630 (intIdentifierEqual):
1631 (intIdentifierHash):
1632 (getIntIdentifierDictionary):
1633 (NPN_GetStringIdentifier):
1634 (NPN_GetStringIdentifiers):
1635 (NPN_GetIntIdentifier):
1636 (NPN_IdentifierIsString):
1637 (NPN_UTF8FromIdentifier):
1638 (NPN_VariantToInt32):
1639 (NPN_VariantToDouble):
1641 * bindings/npruntime.h:
1642 * bindings/objc/WebScriptObject.mm:
1643 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1644 * bindings/runtime_object.cpp:
1645 (RuntimeObjectImp::~RuntimeObjectImp):
1646 * bindings/runtime_root.cpp:
1647 (KJS::Bindings::rootForInterpreter):
1648 * bindings/testbindings.cpp:
1649 (initializeIdentifiers):
1655 === JavaScriptCore-146.1 ===
1657 2004-06-16 Richard Williamson <rjw@apple.com>
1659 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1661 This turned out to be a show stopper for Dashboard. Accessing a nil
1662 ObjC property from JS caused a crash. Similar to the problem
1663 3696112 fixed below.
1667 * bindings/objc/objc_runtime.mm:
1668 (KJS::Bindings::ObjcField::valueFromInstance):
1672 2004-06-16 Richard Williamson <rjw@apple.com>
1674 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1676 This turned out to be a show stopper for Dashboard. We now
1677 return Undefined() when nil is returned from a ObjC method
1678 that returns an object type.
1682 * bindings/objc/objc_utility.mm:
1683 (KJS::Bindings::convertObjcValueToValue):
1687 2004-06-15 Richard Williamson <rjw@apple.com>
1689 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1691 No longer need to check respondsToSelector: for
1692 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1693 because these now have a default implementation on NSObject.
1697 * bindings/objc/objc_class.mm:
1698 (ObjcClass::methodsNamed):
1699 (ObjcClass::fieldNamed):
1701 2004-06-14 Darin Adler <darin@apple.com>
1705 - fixed some things for GC that Patrick missed, or that happened after the branch
1707 * bindings/objc/WebScriptObject.mm:
1708 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1709 (-[WebScriptObject finalize]): Added.
1711 - added some missing nil checks
1713 * bindings/objc/objc_instance.mm:
1714 (ObjcInstance::ObjcInstance): Check for nil.
1715 (ObjcInstance::~ObjcInstance): Check for nil.
1716 (ObjcInstance::operator=): Check for nil.
1718 2004-06-14 Darin Adler <darin@apple.com>
1720 Reviewed by me, code changes by Patrick Beard.
1722 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1724 * bindings/objc/objc_instance.mm:
1725 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1726 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1727 (ObjcInstance::operator=): More of the same.
1728 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1730 * bindings/objc/objc_runtime.mm:
1731 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1732 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1733 (ObjcArray::operator=): More of the same.
1735 * bindings/testbindings.mm: Fixed incorrect license.
1736 (main): Use [pool drain] if compiling on Tiger.
1740 2004-06-10 Kevin Decker <kdecker@apple.com>
1746 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1748 (KJS::Lexer::lineNo):
1749 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1751 === JavaScriptCore-143.2 ===
1753 2004-06-07 Darin Adler <darin@apple.com>
1755 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1757 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1758 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1760 === JavaScriptCore-143.1 ===
1762 2004-06-04 Kevin Decker <kdecker@apple.com>
1766 - fixed <rdar://problem/3680594>
1769 (KJS::Error::create):
1773 2004-06-04 Darin Adler <darin@apple.com>
1775 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1777 2004-06-04 Kevin Decker <kdecker@apple.com>
1781 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1782 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1783 - changed the wording of an error message
1784 - the lexer, parser, and interpreter have been made "sourceURL aware"
1785 - stored the url into Error
1787 * bindings/NP_jsobject.cpp:
1789 * bindings/jni/jni_jsobject.cpp:
1791 * bindings/objc/WebScriptObject.mm:
1792 (-[WebScriptObject evaluateWebScript:]):
1794 (GlobalFuncImp::call):
1795 * kjs/function_object.cpp:
1796 (FunctionObjectImp::construct):
1799 (InterpreterImp::checkSyntax):
1800 (InterpreterImp::evaluate):
1802 * kjs/interpreter.cpp:
1803 (Interpreter::evaluate):
1804 * kjs/interpreter.h:
1808 (KJS::Lexer::sourceURL):
1812 (FunctionCallNode::evaluate):
1815 (KJS::Error::create):
1818 2004-06-04 Richard Williamson <rjw@apple.com>
1820 Fixed crash when attempting to access properties on nil
1825 * bindings/objc/objc_instance.mm:
1826 (ObjcInstance::getClass):
1827 * bindings/runtime_object.cpp:
1828 (RuntimeObjectImp::get):
1829 * bindings/testM.js:
1830 * bindings/testbindings.mm:
1831 (-[MyFirstInterface getString]):
1833 2004-05-27 Kevin Decker <kdecker@apple.com>
1837 -revised generated error message content
1839 * kjs/error_object.cpp:
1840 (ErrorProtoFuncImp::call):
1844 (KJS::Error::create):
1848 2004-05-27 Richard Williamson <rjw@apple.com>
1850 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
1854 * bindings/objc/WebScriptObject.h:
1856 2004-05-27 Darin Adler <darin@apple.com>
1860 - moved to new symlink technique for embedding frameworks
1862 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
1863 because we don't need it any more.
1865 2004-05-24 Richard Williamson <rjw@apple.com>
1867 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
1868 fixed ClassInfo to correctly reflect inheritance. This is required
1869 because of the runtime checks in JSC for arrays, i.e. in
1870 the Function objects apply method.
1874 * bindings/jni/jni_runtime.cpp:
1875 (JavaArray::convertJObjectToArray):
1876 * bindings/objc/objc_utility.mm:
1877 (KJS::Bindings::convertObjcValueToValue):
1878 * bindings/runtime_array.cpp:
1879 (RuntimeArrayImp::RuntimeArrayImp):
1880 * bindings/runtime_array.h:
1881 * bindings/testM.js: Added.
1882 * bindings/testbindings.mm:
1883 (+[MyFirstInterface webScriptNameForSelector:]):
1884 (-[MyFirstInterface logMessages:]):
1885 (-[MyFirstInterface logMessage:prefix:]):
1886 (-[MyFirstInterface callJSObject::]):
1888 2004-05-22 Darin Adler <darin@apple.com>
1892 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
1894 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
1895 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
1896 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
1897 it hasn't been set explicitly.
1901 2004-05-20 Richard Williamson <rjw@apple.com>
1903 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
1904 can now be referenced like any other WebScriptObject, meaning
1905 you can do JS operations on them.
1907 All added implementation of finalizeForWebScript.
1911 * bindings/objc/WebScriptObject.h:
1912 * bindings/objc/WebScriptObject.mm:
1913 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
1914 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1915 (-[WebScriptObject KJS::]):
1916 (-[WebScriptObject dealloc]):
1917 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1918 (-[WebScriptObject evaluateWebScript:]):
1919 (-[WebScriptObject setValue:forKey:]):
1920 (-[WebScriptObject valueForKey:]):
1921 (-[WebScriptObject stringRepresentation]):
1922 * bindings/objc/WebScriptObjectPrivate.h:
1923 * bindings/objc/objc_instance.mm:
1924 (ObjcInstance::~ObjcInstance):
1926 2004-05-19 Richard Williamson <rjw@apple.com>
1928 Removed extraneous tabs that were added (by XCode?).
1930 * bindings/objc/WebScriptObject.h:
1932 2004-05-19 Darin Adler <darin@apple.com>
1934 - fixed headers with licenses mangled by Xcode auto-indenting
1936 * bindings/jni/jni_jsobject.cpp:
1937 * bindings/jni/jni_jsobject.h:
1938 * bindings/runtime_array.h:
1939 * bindings/runtime_root.cpp:
1940 * bindings/runtime_root.h:
1942 2004-05-18 Richard Williamson <rjw@apple.com>
1944 Added exception logging. Also check for exception and
1945 set results as appropriate.
1947 Reviewed by Maciej (partially reviewed).
1949 * bindings/objc/WebScriptObject.mm:
1950 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1951 (-[WebScriptObject evaluateWebScript:]):
1952 (-[WebScriptObject setValue:forKey:]):
1953 (-[WebScriptObject valueForKey:]):
1955 2004-05-18 Richard Williamson <rjw@apple.com>
1957 Finsished implementing support for windowScriptObject.
1958 Had to make WebScriptObjectPrivate.h accessible from
1963 * JavaScriptCore.pbproj/project.pbxproj:
1964 * bindings/objc/WebScriptObjectPrivate.h:
1966 2004-05-18 Richard Williamson <rjw@apple.com>
1968 Use KVC to set/get values instead of directly accessing
1973 * bindings/objc/WebScriptObject.mm:
1974 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1975 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1976 * bindings/objc/objc_runtime.mm:
1977 (ObjcField::valueFromInstance):
1978 (convertValueToObjcObject):
1979 (ObjcField::setValueToInstance):
1981 2004-05-17 Richard Williamson <rjw@apple.com>
1983 Implemented new API for WebScriptObject.
1985 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
1986 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
1990 * JavaScriptCore.pbproj/project.pbxproj:
1991 * bindings/c/c_instance.cpp:
1992 (CInstance::invokeMethod):
1993 * bindings/jni/jni_instance.cpp:
1994 (JavaInstance::invokeMethod):
1995 * bindings/jni/jni_jsobject.cpp:
1996 (JSObject::convertValueToJObject):
1997 * bindings/jni/jni_utility.cpp:
1998 (KJS::Bindings::getJNIField):
1999 * bindings/objc/WebScriptObject.mm:
2001 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2002 (-[WebScriptObject KJS::]):
2003 (-[WebScriptObject dealloc]):
2004 (+[WebScriptObject throwException:]):
2006 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2007 (-[WebScriptObject evaluateWebScript:]):
2008 (-[WebScriptObject setValue:forKey:]):
2009 (-[WebScriptObject valueForKey:]):
2010 (-[WebScriptObject stringRepresentation]):
2011 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2012 (+[WebUndefined undefined]):
2013 (-[WebUndefined initWithCoder:]):
2014 (-[WebUndefined encodeWithCoder:]):
2015 (-[WebUndefined copyWithZone:]):
2016 (-[WebUndefined retain]):
2017 (-[WebUndefined release]):
2018 (-[WebUndefined retainCount]):
2019 (-[WebUndefined autorelease]):
2020 (-[WebUndefined dealloc]):
2021 (-[WebUndefined copy]):
2022 (-[WebUndefined replacementObjectForPortCoder:]):
2023 * bindings/objc/WebScriptObjectPrivate.h: Added.
2024 * bindings/objc/objc_class.mm:
2025 (ObjcClass::methodsNamed):
2026 (ObjcClass::fieldNamed):
2027 * bindings/objc/objc_instance.mm:
2028 (ObjcInstance::invokeMethod):
2029 * bindings/objc/objc_jsobject.h:
2030 * bindings/objc/objc_jsobject.mm:
2031 * bindings/objc/objc_runtime.mm:
2032 (ObjcField::valueFromInstance):
2033 * bindings/objc/objc_utility.mm:
2034 (KJS::Bindings::JSMethodNameToObjCMethodName):
2035 (KJS::Bindings::convertValueToObjcValue):
2036 (KJS::Bindings::convertObjcValueToValue):
2037 * bindings/runtime.cpp:
2038 (Instance::setDidExecuteFunction):
2039 (Instance::didExecuteFunction):
2040 (Instance::setValueOfField):
2041 * bindings/runtime.h:
2042 * bindings/testbindings.mm:
2043 (+[MyFirstInterface webScriptNameForSelector:]):
2044 (-[MyFirstInterface callJSObject::]):
2046 2004-05-14 Vicki Murley <vicki@apple.com>
2050 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2052 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2056 2004-05-13 Richard Williamson <rjw@apple.com>
2063 * bindings/objc/WebScriptObject.h:
2065 2004-05-13 Richard Williamson <rjw@apple.com>
2067 Approved API changes. Currently unimplemented.
2072 * JavaScriptCore.pbproj/project.pbxproj:
2073 * bindings/objc/WebScriptObject.h: Added.
2074 * bindings/objc/WebScriptObject.mm: Added.
2075 (+[WebScriptObject throwException:]):
2076 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2077 (-[WebScriptObject evaluateWebScript:]):
2078 (-[WebScriptObject stringRepresentation]):
2079 (+[WebUndefined undefined]):
2080 (-[WebUndefined initWithCoder:]):
2081 (-[WebUndefined encodeWithCoder:]):
2082 (-[WebUndefined copyWithZone:]):
2084 2004-05-07 Vicki Murley <vicki@apple.com>
2088 Turn off GC since it uses ppc only instructions (which breaks
2091 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2095 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2099 - add -funroll-loops=16 compiler option for approx .5% speedup on
2100 HTML iBench and .5-1% speedup on JS iBench.
2102 * JavaScriptCore.pbproj/project.pbxproj:
2104 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2108 Enable full conservative GC mode in addition to test mode. When
2109 conservative GC is enabled, we now get an 11% speed improvement on
2110 the iBench. Also fix some spots I missed before.
2112 Specific noteworth changes:
2114 * kjs/collector.cpp:
2115 (KJS::Collector::markStackObjectsConservatively): Check possible
2116 cell pointers for 8-byte aligment and verify they are not 0.
2118 * kjs/protected_values.cpp:
2119 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2120 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2122 (KJS::gcProtectNullTolerant): ...to here...
2123 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2124 tolerance, and doing the check is expensive.
2126 * kjs/protected_values.cpp:
2127 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2128 that is still very good.
2133 (KJS::ProtectedValue::ProtectedValue):
2134 (KJS::ProtectedValue::~ProtectedValue):
2135 (KJS::ProtectedValue::operator=):
2136 (KJS::ProtectedObject::ProtectedObject):
2137 (KJS::ProtectedObject::~ProtectedObject):
2138 (KJS::ProtectedObject::operator=):
2139 (KJS::ProtectedReference::ProtectedReference):
2140 (KJS::ProtectedReference::~ProtectedReference):
2141 (KJS::ProtectedReference::operator=):
2142 * kjs/protected_values.cpp:
2143 (KJS::ProtectedValues::getProtectCount):
2144 (KJS::ProtectedValues::increaseProtectCount):
2145 (KJS::ProtectedValues::decreaseProtectCount):
2146 (KJS::ProtectedValues::computeHash):
2147 * bindings/runtime_root.cpp:
2148 (KJS::Bindings::addNativeReference):
2149 (KJS::Bindings::removeNativeReference):
2150 (RootObject::removeAllNativeReferences):
2151 * bindings/runtime_root.h:
2152 (KJS::Bindings::RootObject::~RootObject):
2153 (KJS::Bindings::RootObject::setRootObjectImp):
2154 * kjs/collector.cpp:
2155 (KJS::Collector::allocate):
2156 (KJS::Collector::collect):
2159 (NumberImp::create):
2160 (InterpreterImp::globalInit):
2161 (InterpreterImp::globalClear):
2162 (InterpreterImp::mark):
2164 (KJS::List::derefValues):
2165 (KJS::List::refValues):
2166 (KJS::List::append):
2168 (KJS::ObjectImp::setInternalValue):
2169 (KJS::ObjectImp::putDirect):
2174 (KJS::ValueImp::ValueImp):
2175 (KJS::ValueImp::~ValueImp):
2177 (KJS::Value::Value):
2178 (KJS::Value::~Value):
2179 (KJS::Value::operator=):
2181 2004-04-30 Richard Williamson <rjw@apple.com>
2183 Asking an NSInvocation for it's return value when return type
2184 is void throws an exception. Added check for void return types
2185 to avoid this exception.
2189 * bindings/objc/objc_instance.mm:
2190 (ObjcInstance::invokeMethod):
2192 2004-04-29 Richard Williamson <rjw@apple.com>
2194 Fixed several bad problems with the ObjC bindings. In particular, conversion
2195 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2199 * bindings/objc/objc_jsobject.h:
2200 * bindings/objc/objc_jsobject.mm:
2201 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2202 (-[JavaScriptObject KJS::]):
2203 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2204 (-[JavaScriptObject call:arguments:]):
2205 (-[JavaScriptObject evaluate:]):
2206 (-[JavaScriptObject getMember:]):
2207 (-[JavaScriptObject getSlot:]):
2208 * bindings/objc/objc_runtime.mm:
2209 (ObjcField::valueFromInstance):
2210 (ObjcField::setValueToInstance):
2211 * bindings/objc/objc_utility.mm:
2212 (KJS::Bindings::convertValueToObjcValue):
2213 (KJS::Bindings::convertObjcValueToValue):
2214 * bindings/runtime.h:
2215 * bindings/runtime_root.cpp:
2216 (KJS::Bindings::rootForInterpreter):
2217 (KJS::Bindings::addNativeReference):
2218 (KJS::Bindings::removeNativeReference):
2219 * bindings/runtime_root.h:
2220 * bindings/testbindings.mm:
2221 (-[MyFirstInterface logMessage:]):
2222 (-[MyFirstInterface setJSObject:]):
2223 (-[MyFirstInterface callJSObject::]):
2225 2004-04-24 Darin Adler <darin@apple.com>
2229 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2232 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2236 Implementation of conservative GC, based partly on code from
2237 Darin. It's turned off for now, so it shouldn't have any effect on
2240 * JavaScriptCore.pbproj/project.pbxproj:
2241 * kjs/collector.cpp:
2242 (KJS::Collector::markStackObjectsConservatively):
2243 (KJS::Collector::markProtectedObjects):
2244 (KJS::Collector::collect):
2249 * kjs/protected_values.cpp: Added.
2250 (KJS::ProtectedValues::getProtectCount):
2251 (KJS::ProtectedValues::increaseProtectCount):
2252 (KJS::ProtectedValues::insert):
2253 (KJS::ProtectedValues::decreaseProtectCount):
2254 (KJS::ProtectedValues::expand):
2255 (KJS::ProtectedValues::shrink):
2256 (KJS::ProtectedValues::rehash):
2257 (KJS::ProtectedValues::computeHash):
2258 * kjs/protected_values.h: Added.
2260 (ValueImp::useConservativeMark):
2268 2004-04-22 Richard Williamson <rjw@apple.com>
2270 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2273 * bindings/npruntime.h:
2275 2004-04-22 Richard Williamson <rjw@apple.com>
2277 Updated plugin binding API to reflect latest revision from
2280 Biggest change is the introduction of NPVariant used to represent
2281 value types. NPVariant replaces the use of NPObject for the
2282 exchange of values between scripting environment and native code.
2286 * JavaScriptCore.pbproj/project.pbxproj:
2287 * bindings/NP_jsobject.cpp:
2288 (identiferFromNPIdentifier):
2294 (NPN_GetPropertyAtIndex):
2295 (NPN_SetPropertyAtIndex):
2296 * bindings/c/c_class.cpp:
2297 (CClass::methodsNamed):
2298 (CClass::fieldNamed):
2299 * bindings/c/c_instance.cpp:
2300 (CInstance::invokeMethod):
2301 (CInstance::defaultValue):
2302 * bindings/c/c_runtime.cpp:
2303 (CField::valueFromInstance):
2304 (CField::setValueToInstance):
2305 * bindings/c/c_utility.cpp:
2306 (convertNPStringToUTF16):
2307 (convertUTF8ToUTF16):
2308 (coerceValueToNPVariantStringType):
2309 (convertValueToNPVariant):
2310 (convertNPVariantToValue):
2311 * bindings/c/c_utility.h:
2312 * bindings/npruntime.cpp:
2313 (NPN_GetIdentifier):
2314 (NPN_GetIdentifiers):
2315 (NPN_UTF8FromIdentifier):
2316 (NPN_VariantIsVoid):
2317 (NPN_VariantIsNull):
2318 (NPN_VariantIsUndefined):
2319 (NPN_VariantIsBool):
2320 (NPN_VariantIsInt32):
2321 (NPN_VariantIsDouble):
2322 (NPN_VariantIsString):
2323 (NPN_VariantIsObject):
2324 (NPN_VariantToBool):
2325 (NPN_VariantToString):
2326 (NPN_VariantToInt32):
2327 (NPN_VariantToDouble):
2328 (NPN_VariantToObject):
2329 (NPN_InitializeVariantAsVoid):
2330 (NPN_InitializeVariantAsNull):
2331 (NPN_InitializeVariantAsUndefined):
2332 (NPN_InitializeVariantWithBool):
2333 (NPN_InitializeVariantWithInt32):
2334 (NPN_InitializeVariantWithDouble):
2335 (NPN_InitializeVariantWithString):
2336 (NPN_InitializeVariantWithStringCopy):
2337 (NPN_InitializeVariantWithObject):
2338 (NPN_InitializeVariantWithVariant):
2339 (NPN_ReleaseVariantValue):
2342 (NPN_ReleaseObject):
2343 (NPN_IsKindOfClass):
2344 (NPN_SetExceptionWithUTF8):
2346 * bindings/npruntime.h:
2348 (_NPString::_NPVariant::):
2349 * bindings/testbindings.cpp:
2364 2004-04-22 Darin Adler <darin@apple.com>
2368 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2371 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2372 Was resulting in a buffer 2x the needed size.
2373 (KJS::UString::expandPreCapacity): Ditto.
2374 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2376 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2380 Preliminary change for conservative GC. Create "protected"
2381 subclasses to GC-protect objects when on heap, since we will soon
2382 remove the built-in refcounting of the normal wrapper classes. Use
2385 * JavaScriptCore.pbproj/project.pbxproj:
2388 (KJS::InterpreterImp::globalObject):
2389 * kjs/interpreter.h:
2390 * kjs/property_map.cpp:
2392 * kjs/reference_list.cpp:
2394 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2398 Optimize prepend using the shared substring optimization. Also,
2399 limit the applicability of shared append and shared prepend. If
2400 you overdo it, it does more harm than good, because you create a
2401 bunch of strings that are disqualified from future shared
2402 append/prepend, for not much immediate savings in allocate/copy
2407 (KJS::UString::Rep::create):
2408 (KJS::UString::expandedSize):
2409 (KJS::UString::usedPreCapacity):
2410 (KJS::UString::expandCapacity):
2411 (KJS::UString::expandPreCapacity):
2412 (KJS::UString::UString):
2413 (KJS::UString::append):
2414 (KJS::UString::operator=):
2416 (KJS::UString::Rep::data):
2418 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2419 Reviewed by Richard.
2421 No more need for Completion or Reference to privately inherit from
2422 Value, none of the superclass functionality is used.
2429 2004-04-16 Richard Williamson <rjw@apple.com>
2431 Added interpreter lock protection around object creation.
2435 * bindings/runtime.cpp:
2436 (Instance::createRuntimeObject):
2438 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2442 Another JavaScript speed improvement: use the mechanism from
2443 string append optimization to make taking a substring fast, again
2446 A further 22% improvement on the 24fun string speed test.
2450 (KJS::UString::Rep::create):
2451 (KJS::UString::UString):
2452 (KJS::UString::append):
2453 (KJS::UString::operator=):
2454 (KJS::UString::substr):
2456 (KJS::UString::Rep::data):
2458 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2462 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2463 - fixed <rdar://problem/3600691>: Table generation test is really slow
2464 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2466 80% speedup on the string test, lesser speedups on the other two.
2468 Two different optimizations here:
2470 1) Avoid large overhead of scanning strings to see if they are all
2471 ASCII before numeric conversion.
2474 (AssignNode::evaluate): Don't convert to integer until we know for
2475 sure the operation will need it. Attempting to convert strings to
2476 numbers is a waste when they are being appended with +=.
2478 2) Avoid huge cost of appending strings.
2480 This is done by allowing multiple strings to share a buffer but
2481 actually use different ranges of it. The first time a string is
2482 appended to, we start leaving at least 10% extra space in the
2483 buffer, so doing N appends to the same string takes O(log N)
2484 mallocs instead of O(N).
2486 * kjs/identifier.cpp:
2487 (KJS::Identifier::equal):
2488 (KJS::Identifier::add):
2491 (KJS::UCharReference::operator=):
2492 (KJS::UCharReference::ref):
2493 (KJS::UString::Rep::create):
2494 (KJS::UString::Rep::destroy):
2495 (KJS::UString::expandedSize):
2496 (KJS::UString::usedCapacity):
2497 (KJS::UString::expandCapacity):
2498 (KJS::UString::UString):
2499 (KJS::UString::null):
2500 (KJS::UString::append):
2501 (KJS::UString::operator=):
2502 (KJS::UString::toStrictUInt32):
2503 (KJS::UString::detach):
2504 (KJS::KJS::operator==):
2506 (KJS::UString::Rep::data):
2507 (KJS::UString::Rep::hash):
2509 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2513 - fix deployment build by avoiding deployment-only warning.
2515 * kjs/scope_chain.cpp:
2516 (KJS::ScopeChain::bottom):
2518 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2522 Changed things so that newly created objects get a prototype based
2523 on the scope chain of the current function, rather than the
2524 interpreter that started execution. This fixes the following bugs:
2526 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2527 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2529 * JavaScriptCore.pbproj/project.pbxproj:
2530 * kjs/array_object.cpp:
2531 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2532 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2533 (ArrayProtoFuncImp::call):
2534 (ArrayObjectImp::construct):
2535 * kjs/bool_object.cpp:
2536 (BooleanObjectImp::construct):
2537 * kjs/date_object.cpp:
2538 (DateProtoFuncImp::DateProtoFuncImp):
2539 (DateProtoFuncImp::call):
2540 (DateObjectImp::construct):
2541 * kjs/error_object.cpp:
2542 (ErrorObjectImp::construct):
2544 (FunctionImp::FunctionImp):
2545 (FunctionImp::call):
2546 (DeclaredFunctionImp::construct):
2547 (ArgumentsImp::ArgumentsImp):
2548 (GlobalFuncImp::call):
2549 * kjs/function_object.cpp:
2550 (FunctionProtoFuncImp::call):
2551 (FunctionObjectImp::construct):
2553 (BooleanImp::toObject):
2554 (StringImp::toObject):
2555 (NumberImp::toObject):
2556 (InterpreterImp::InterpreterImp):
2557 (InterpreterImp::clear):
2558 (InterpreterImp::interpreterWithGlobalObject):
2560 * kjs/interpreter.cpp:
2561 (ExecState::lexicalInterpreter):
2562 * kjs/interpreter.h:
2563 (KJS::ExecState::dynamicInterpreter):
2564 (KJS::ExecState::interpreter):
2565 * kjs/math_object.cpp:
2566 (MathFuncImp::MathFuncImp):
2568 (StatementNode::hitStatement):
2569 (StatementNode::abortStatement):
2570 (RegExpNode::evaluate):
2571 (ElementNode::evaluate):
2572 (ArrayNode::evaluate):
2573 (ObjectLiteralNode::evaluate):
2574 (PropertyValueNode::evaluate):
2575 (FunctionCallNode::evaluate):
2576 (FuncDeclNode::processFuncDecl):
2577 (FuncExprNode::evaluate):
2578 * kjs/number_object.cpp:
2579 (NumberObjectImp::construct):
2581 (KJS::ObjectImp::defaultValue):
2582 (KJS::Error::create):
2583 * kjs/object_object.cpp:
2584 (ObjectObjectImp::construct):
2585 * kjs/reference.cpp:
2586 (Reference::putValue):
2587 * kjs/regexp_object.cpp:
2588 (RegExpProtoFuncImp::call):
2589 (RegExpObjectImp::arrayOfMatches):
2590 (RegExpObjectImp::construct):
2591 * kjs/scope_chain.cpp:
2592 (KJS::ScopeChain::bottom):
2593 * kjs/scope_chain.h:
2594 * kjs/string_object.cpp:
2595 (StringProtoFuncImp::StringProtoFuncImp):
2596 (StringProtoFuncImp::call):
2597 (StringObjectImp::construct):
2603 2004-03-31 Richard Williamson <rjw@apple.com>
2605 Tedious renames based on feedback from plugin-futures list.
2606 NP_ functions are renamed with NPN_ prefix.
2607 Types prefix renamed from NP_ to NP.
2608 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2610 No review because this was just a renaming patch.
2612 * bindings/NP_jsobject.cpp:
2615 (identiferFromNPIdentifier):
2620 (NPN_RemoveProperty):
2622 (NPN_GetPropertyAtIndex):
2623 (NPN_SetPropertyAtIndex):
2624 * bindings/NP_jsobject.h:
2625 * bindings/c/c_class.cpp:
2626 (CClass::_commonInit):
2627 (CClass::classForIsA):
2629 (CClass::methodsNamed):
2630 (CClass::fieldNamed):
2631 * bindings/c/c_class.h:
2632 * bindings/c/c_instance.cpp:
2633 (CInstance::CInstance):
2634 (CInstance::~CInstance):
2635 (CInstance::operator=):
2636 (CInstance::invokeMethod):
2637 (CInstance::defaultValue):
2638 * bindings/c/c_instance.h:
2639 (KJS::Bindings::CInstance::getObject):
2640 * bindings/c/c_runtime.cpp:
2641 (CField::valueFromInstance):
2642 (CField::setValueToInstance):
2643 * bindings/c/c_runtime.h:
2644 (KJS::Bindings::CField::CField):
2645 (KJS::Bindings::CField::name):
2646 (KJS::Bindings::CMethod::CMethod):
2647 (KJS::Bindings::CMethod::name):
2648 * bindings/c/c_utility.cpp:
2649 (coerceValueToNPString):
2650 (convertValueToNPValueType):
2651 (convertNPValueTypeToValue):
2652 * bindings/c/c_utility.h:
2653 * bindings/npruntime.cpp:
2654 (NPN_IdentifierFromUTF8):
2655 (NPN_IsValidIdentifier):
2656 (NPN_GetIdentifiers):
2657 (NPN_UTF8FromIdentifier):
2660 (NPN_ReleaseObject):
2661 (NPN_IsKindOfClass):
2662 (NPN_SetExceptionWithUTF8):
2665 (NPN_CreateNumberWithInt):
2666 (NPN_CreateNumberWithFloat):
2667 (NPN_CreateNumberWithDouble):
2668 (NPN_IntFromNumber):
2669 (NPN_FloatFromNumber):
2670 (NPN_DoubleFromNumber):
2672 (NPN_CreateStringWithUTF8):
2673 (NPN_CreateStringWithUTF16):
2674 (NPN_DeallocateUTF8):
2675 (NPN_UTF8FromString):
2676 (NPN_UTF16FromString):
2679 (NPN_CreateBoolean):
2680 (NPN_BoolFromBoolean):
2683 (undefinedAllocate):
2689 (NPN_ObjectAtIndex):
2690 * bindings/npruntime.h:
2691 * bindings/runtime.cpp:
2692 (Instance::createBindingForLanguageInstance):
2693 * bindings/testbindings.cpp:
2694 (initializeIdentifiers):
2714 2004-03-31 Richard Williamson <rjw@apple.com>
2716 Changed references to NP_runtime.h to npruntime.h
2718 * JavaScriptCore.pbproj/project.pbxproj:
2719 * bindings/NP_jsobject.h:
2720 * bindings/c/c_class.h:
2721 * bindings/c/c_instance.h:
2722 * bindings/c/c_runtime.h:
2723 * bindings/c/c_utility.h:
2724 * bindings/npruntime.cpp:
2726 2004-03-31 Richard Williamson <rjw@apple.com>
2728 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2730 * JavaScriptCore.pbproj/project.pbxproj:
2731 * bindings/NP_jsobject.h:
2732 * bindings/npruntime.cpp:
2736 2004-03-23 Richard Williamson <rjw@apple.com>
2738 Added implementation of KJS::Value <-> NP_Object conversion functions.
2739 Augmented test program for 'C' bindings.
2740 Added asserts and parameter checking to all public API.
2744 * JavaScriptCore.pbproj/project.pbxproj:
2745 * bindings/NP_jsobject.cpp:
2747 * bindings/NP_jsobject.h: Added.
2748 * bindings/NP_runtime.cpp:
2749 (NP_IdentifierFromUTF8):
2750 (NP_IsValidIdentifier):
2751 (NP_GetIdentifiers):
2756 (NP_SetExceptionWithUTF8):
2759 (NP_FloatFromNumber):
2760 (NP_DoubleFromNumber):
2761 (NP_CreateStringWithUTF8):
2762 (NP_CreateStringWithUTF16):
2763 (NP_DeallocateUTF8):
2764 (NP_UTF8FromString):
2765 (NP_UTF16FromString):
2767 (NP_BoolFromBoolean):
2768 * bindings/NP_runtime.h:
2769 * bindings/c/c_instance.cpp:
2770 (CInstance::invokeMethod):
2771 * bindings/c/c_utility.cpp:
2772 (coerceValueToNPString):
2773 (convertValueToNPValueType):
2774 (convertNPValueTypeToValue):
2775 * bindings/c/c_utility.h:
2777 * bindings/testC.js: Added.
2778 * bindings/testbindings.cpp:
2788 (myInterfaceInvoke):
2789 (myInterfaceAllocate):
2793 2004-03-19 Darin Adler <darin@apple.com>
2797 - fixed problem with methods like setUTCHour
2799 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2800 GMT vs. local time function based on the utc flag.
2802 2004-03-17 Richard Williamson <rjw@apple.com>
2804 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2808 * bindings/NP_jsobject.cpp:
2813 (NP_GetPropertyAtIndex):
2814 * bindings/NP_runtime.h:
2816 2004-03-16 Richard Williamson <rjw@apple.com>
2818 Fixed 3590169. Regression (crash) caused by the switch to MethodLists. Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
2822 * bindings/jni/jni_class.cpp:
2823 (JavaClass::methodsNamed):
2825 2004-03-15 Richard Williamson <rjw@apple.com>
2827 Fixed 3570854. Don't attempt to convert Null to strings. We
2828 were incorrectly converting to "Null".
2830 Actually fixed by Scott Kovatch.
2832 Reviewed by Richard.
2834 * bindings/jni/jni_utility.cpp:
2835 (KJS::Bindings::convertValueToJValue):
2839 2004-03-11 Richard Williamson <rjw@apple.com>
2841 Stitched together the NP stuff to our language independent
2842 JavaScript binding stuff. Very close to being done.
2844 Added program to test C bindings (and NP stuff). Just tests
2845 properties. Will add methods and JavaScript access, etc.
2847 Updated Makefile.am to account for new bindings/c directory.
2849 Change NP_UTF8 from "const char *" to "char" to allow for
2850 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
2853 Added NP_IsValidIdentifier().
2857 * JavaScriptCore.pbproj/project.pbxproj:
2859 * bindings/NP_jsobject.cpp:
2860 (identiferFromNPIdentifier):
2862 * bindings/NP_runtime.cpp:
2863 (NP_IdentifierFromUTF8):
2864 (NP_IsValidIdentifier):
2865 (NP_GetIdentifiers):
2866 (NP_UTF8FromIdentifier):
2867 (NP_SetExceptionWithUTF8):
2869 (NP_CreateStringWithUTF8):
2870 (NP_CreateStringWithUTF16):
2871 (NP_UTF8FromString):
2872 (NP_UTF16FromString):
2873 * bindings/NP_runtime.h:
2874 * bindings/c/c_class.cpp: Added.
2875 (CClass::_commonDelete):
2876 (CClass::_commonCopy):
2877 (CClass::_commonInit):
2878 (_createClassesByIsAIfNecessary):
2879 (CClass::classForIsA):
2882 (CClass::methodsNamed):
2883 (CClass::fieldNamed):
2884 * bindings/c/c_class.h: Added.
2885 (KJS::Bindings::CClass::~CClass):
2886 (KJS::Bindings::CClass::CClass):
2887 (KJS::Bindings::CClass::operator=):
2888 (KJS::Bindings::CClass::constructorAt):
2889 (KJS::Bindings::CClass::numConstructors):
2890 * bindings/c/c_instance.cpp: Added.
2891 (CInstance::CInstance):
2892 (CInstance::~CInstance):
2893 (CInstance::operator=):
2894 (CInstance::getClass):
2897 (CInstance::invokeMethod):
2898 (CInstance::defaultValue):
2899 (CInstance::stringValue):
2900 (CInstance::numberValue):
2901 (CInstance::booleanValue):
2902 (CInstance::valueOf):
2903 * bindings/c/c_instance.h: Added.
2904 (KJS::Bindings::CInstance::getObject):
2905 * bindings/c/c_runtime.cpp: Added.
2906 (CField::valueFromInstance):
2907 (CField::setValueToInstance):
2908 * bindings/c/c_runtime.h: Added.
2909 (KJS::Bindings::CField::CField):
2910 (KJS::Bindings::CField::name):
2911 (KJS::Bindings::CField::type):
2912 (KJS::Bindings::CMethod::CMethod):
2913 (KJS::Bindings::CMethod::name):
2914 (KJS::Bindings::CMethod::numParameters):
2915 * bindings/c/c_utility.cpp: Added.
2916 (coerceValueToNPValueType):
2917 (convertValueToNPValueType):
2918 (convertNPValueTypeToValue):
2919 * bindings/c/c_utility.h: Added.
2920 * bindings/make_testbindings:
2921 * bindings/runtime.cpp:
2922 (Instance::createBindingForLanguageInstance):
2923 * bindings/runtime.h:
2924 (KJS::Bindings::Instance::):
2925 * bindings/testbindings.cpp: Added.
2926 (initializeIdentifiers):
2927 (myInterfaceHasProperty):
2928 (myInterfaceHasMethod):
2929 (myInterfaceGetProperty):
2930 (myInterfaceSetProperty):
2931 (myInterfaceInvoke):
2932 (myInterfaceAllocate):
2933 (myInterfaceInvalidate):
2934 (myInterfaceDeallocate):
2935 (GlobalImp::className):
2936 (readJavaScriptFromFile):
2939 2004-03-10 Richard Williamson <rjw@apple.com>
2941 Made changes to support new asychronous approach to calls from
2942 plugin to JavaScript
2946 * bindings/NP_jsobject.cpp:
2951 (NP_GetPropertyAtIndex):
2952 * bindings/NP_runtime.h:
2953 * bindings/make_testbindings:
2954 * bindings/runtime.cpp:
2955 (Instance::createBindingForLanguageInstance):
2957 2004-03-10 Richard Williamson <rjw@apple.com>
2959 Updated header to include proposed changes from
2960 plugin-futures list. Calls from plugin to JavaScript
2961 are now asynchronous.
2965 * bindings/NP_runtime.h:
2969 2004-03-04 Richard Williamson <rjw@apple.com>
2971 Implementation of NP_JavaScriptObject. This is the 'C' class
2972 that wraps a JavaScript object.
2976 * JavaScriptCore.pbproj/project.pbxproj:
2977 * bindings/NP_jsobject.cpp: Added.
2978 (coerceValueToNPValueType):
2979 (convertValueToNPValueType):
2980 (convertNPValueTypeToValue):
2984 (identiferFromNPIdentifier):
2989 (NP_RemoveProperty):
2991 (NP_GetPropertyAtIndex):
2992 (NP_SetPropertyAtIndex):
2993 * bindings/NP_runtime.cpp:
2995 * bindings/NP_runtime.h:
2996 * bindings/runtime_object.h:
2998 2004-03-04 Richard Williamson <rjw@apple.com>
3000 Added NP_Array implementation.
3002 Changed NP_Boolean to just depend on two static instances, no
3003 space is required for values.
3007 * bindings/NP_runtime.cpp:
3009 (NP_BoolFromBoolean):
3015 * bindings/NP_runtime.h:
3017 2004-03-03 Darin Adler <darin@apple.com>
3021 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3022 copyright string, and that's all that was in here.
3023 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3025 2004-03-03 Richard Williamson <rjw@apple.com>
3027 More 'C' binding implementation. Fleshed out all the
3028 'primitive' data types.
3032 * bindings/NP_runtime.cpp:
3037 (NP_CreateStringWithUTF8):
3038 (NP_CreateStringWithUTF16):
3039 (NP_UTF8FromString):
3040 (NP_UTF16FromString):
3043 (booleanDeallocate):
3045 (NP_BoolFromBoolean):
3049 (undefinedAllocate):
3050 (undefinedDeallocate):
3052 * bindings/NP_runtime.h:
3054 2004-03-03 Richard Williamson <rjw@apple.com>
3056 More 'C' binding implementation.
3060 * bindings/NP_runtime.cpp:
3063 (getIdentifierDictionary):
3064 (NP_IdentifierFromUTF8):
3065 (NP_UTF8FromIdentifier):
3070 (NP_CreateNumberWithInt):
3071 (NP_CreateNumberWithFloat):
3072 (NP_CreateNumberWithDouble):
3074 (NP_FloatFromNumber):
3075 (NP_DoubleFromNumber):
3076 * bindings/NP_runtime.h:
3078 2004-03-02 Richard Williamson <rjw@apple.com>
3080 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3081 own customer retain/release scheme.
3085 * bindings/NP_runtime.cpp:
3088 * bindings/NP_runtime.h:
3090 2004-03-02 Richard Williamson <rjw@apple.com>
3092 C binding API. Partial implementation.
3094 Completed ObjectiveC bindings (not based on the C API). These will re-implemented over the C binding API, but I wanted to get this code in the tree.
3096 Factored root object reference counting scheme. It is now useful independent
3101 * JavaScriptCore.pbproj/project.pbxproj:
3102 * bindings/NP_runtime.cpp: Added.
3103 (NP_IdentifierFromUTF8):
3104 (NP_GetIdentifiers):
3105 (NP_UTF8FromIdentifier):
3115 (NP_RemoveProperty):
3117 (NP_GetPropertyAtIndex):
3118 (NP_SetPropertyAtIndex):
3119 (NP_CreateNumberWithInt):
3120 (NP_CreateNumberWithFloat):
3121 (NP_CreateNumberWithDouble):
3123 (NP_FloatFromNumber):
3124 (NP_DoubleFromNumber):
3125 (NP_CreateStringWithUTF8):
3126 (NP_CreateStringWithUTF16):
3127 (NP_UTF8FromString):
3128 (NP_UTF16FromString):
3130 (NP_BoolFromBoolean):
3136 * bindings/NP_runtime.h: Added.
3137 * bindings/jni/jni_jsobject.cpp:
3139 (JSObject::finalize):
3140 (JSObject::createNative):
3141 (JSObject::convertValueToJObject):
3142 * bindings/jni/jni_jsobject.h:
3143 * bindings/objc/objc_jsobject.h:
3144 * bindings/objc/objc_jsobject.mm:
3146 (windowJavaScriptObject):
3147 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3148 (-[JavaScriptObject dealloc]):
3149 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3150 (-[JavaScriptObject call:arguments:]):
3151 (-[JavaScriptObject evaluate:]):
3152 (-[JavaScriptObject getMember:]):
3153 (-[JavaScriptObject setMember:value:]):
3154 (-[JavaScriptObject removeMember:]):
3155 (-[JavaScriptObject toString]):
3156 (-[JavaScriptObject getSlot:]):
3157 (-[JavaScriptObject setSlot:value:]):
3158 * bindings/objc/objc_utility.h:
3159 * bindings/objc/objc_utility.mm:
3160 (KJS::Bindings::convertValueToObjcValue):
3161 * bindings/runtime_root.cpp: Added.
3162 (getReferencesByRootDictionary):
3163 (getReferencesDictionary):
3164 (KJS::Bindings::findReferenceDictionary):
3165 (KJS::Bindings::rootForImp):
3166 (KJS::Bindings::addNativeReference):
3167 (KJS::Bindings::removeNativeReference):
3168 (completedJavaScriptAccess):
3169 (initializeJavaScriptAccessLock):
3170 (lockJavaScriptAccess):
3171 (unlockJavaScriptAccess):
3172 (RootObject::dispatchToJavaScriptThread):
3173 (performJavaScriptAccess):
3174 (RootObject::setFindRootObjectForNativeHandleFunction):
3175 (RootObject::removeAllNativeReferences):
3176 * bindings/runtime_root.h: Added.
3177 (KJS::Bindings::RootObject::RootObject):
3178 (KJS::Bindings::RootObject::~RootObject):
3179 (KJS::Bindings::RootObject::setRootObjectImp):
3180 (KJS::Bindings::RootObject::rootObjectImp):
3181 (KJS::Bindings::RootObject::setInterpreter):
3182 (KJS::Bindings::RootObject::interpreter):
3183 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3184 (KJS::Bindings::RootObject::runLoop):
3185 (KJS::Bindings::RootObject::performJavaScriptSource):
3191 2004-02-18 Richard Williamson <rjw@apple.com>
3193 Added NSNumber/Number conversion.
3195 Removed some unnecessary KJS:: namespace specifiers.
3199 * bindings/objc/objc_utility.mm:
3200 (KJS::Bindings::convertValueToObjcValue):
3201 (KJS::Bindings::convertObjcValueToValue):
3202 * bindings/runtime_array.h:
3204 2004-02-18 Richard Williamson <rjw@apple.com>
3206 Added support for export NSArrays.
3208 Updated valueAt() to take an ExecState so we can throw
3211 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
3212 ObjectiveC classes to control the visibility of their methods in
3217 * bindings/jni/jni_runtime.cpp:
3218 (JavaField::valueFromInstance):
3219 (JavaArray::valueAt):
3220 * bindings/jni/jni_runtime.h:
3221 * bindings/objc/objc_class.mm:
3222 (ObjcClass::methodsNamed):
3223 * bindings/objc/objc_runtime.h:
3224 (KJS::Bindings::ObjcArray::getObjcArray):
3225 * bindings/objc/objc_runtime.mm:
3226 (ObjcField::valueFromInstance):
3227 (ObjcField::setValueToInstance):
3228 (ObjcArray::ObjcArray):
3229 (ObjcArray::~ObjcArray):
3230 (ObjcArray::operator=):
3231 (ObjcArray::setValueAt):
3232 (ObjcArray::valueAt):
3233 (ObjcArray::getLength):
3234 * bindings/objc/objc_utility.mm:
3235 (KJS::Bindings::convertValueToObjcValue):
3236 (KJS::Bindings::convertObjcValueToValue):
3237 * bindings/runtime.cpp:
3238 (Instance::getValueOfField):
3239 * bindings/runtime.h:
3240 * bindings/runtime_array.cpp:
3241 (RuntimeArrayImp::get):
3242 * bindings/runtime_object.cpp:
3243 (RuntimeObjectImp::get):
3245 2004-02-17 Richard Williamson <rjw@apple.com>
3247 Added String <-> NSString conversion.
3248 Added tests of String <-> NSString conversion to test program.
3252 * bindings/objc/objc_utility.mm:
3253 (KJS::Bindings::convertValueToObjcValue):
3254 (KJS::Bindings::convertObjcValueToValue):
3256 * bindings/testbindings.mm:
3257 (-[MyFirstInterface getString]):
3259 2004-02-15 Darin Adler <darin@apple.com>
3263 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3264 and removing redundant settings of things that match defaults in other build styles.
3266 2004-02-13 Richard Williamson <rjw@apple.com>
3268 Work towards the JavaScript ObjC bindings. The bindings now work for
3269 simple scalar types. testbindings.mm is an illustration of how the
3274 * JavaScriptCore.pbproj/project.pbxproj:
3276 * bindings/jni/jni_class.cpp:
3277 (JavaClass::methodsNamed):
3278 * bindings/jni/jni_class.h:
3279 * bindings/jni/jni_instance.cpp:
3280 (JavaInstance::invokeMethod):
3281 * bindings/jni/jni_instance.h:
3282 * bindings/jni/jni_runtime.h:
3283 (KJS::Bindings::JavaMethod::returnType):
3284 * bindings/make_testbindings: Added.
3285 * bindings/objc/objc_class.h: Added.
3286 (KJS::Bindings::ObjcClass::~ObjcClass):
3287 (KJS::Bindings::ObjcClass::ObjcClass):
3288 (KJS::Bindings::ObjcClass::operator=):
3289 (KJS::Bindings::ObjcClass::constructorAt):
3290 (KJS::Bindings::ObjcClass::numConstructors):
3291 * bindings/objc/objc_class.mm: Added.
3292 (ObjcClass::_commonDelete):
3293 (ObjcClass::_commonCopy):
3294 (ObjcClass::_commonInit):
3295 (_createClassesByIsAIfNecessary):
3296 (ObjcClass::classForIsA):
3297 (ObjcClass::ObjcClass):
3299 (ObjcClass::methodsNamed):
3300 (ObjcClass::fieldNamed):
3301 * bindings/objc/objc_header.h: Added.
3302 * bindings/objc/objc_instance.h: Added.
3303 (KJS::Bindings::ObjcInstance::getObject):
3304 * bindings/objc/objc_instance.mm: Added.
3305 (ObjcInstance::ObjcInstance):
3306 (ObjcInstance::~ObjcInstance):
3307 (ObjcInstance::operator=):
3308 (ObjcInstance::begin):
3309 (ObjcInstance::end):
3310 (ObjcInstance::getClass):
3311 (ObjcInstance::invokeMethod):
3312 (ObjcInstance::defaultValue):
3313 (ObjcInstance::stringValue):
3314 (ObjcInstance::numberValue):
3315 (ObjcInstance::booleanValue):
3316 (ObjcInstance::valueOf):
3317 * bindings/objc/objc_jsobject.h: Added.
3318 * bindings/objc/objc_jsobject.mm: Added.
3319 * bindings/objc/objc_runtime.h:
3320 (KJS::Bindings::ObjcField::~ObjcField):
3321 (KJS::Bindings::ObjcField::ObjcField):
3322 (KJS::Bindings::ObjcField::operator=):
3323 (KJS::Bindings::ObjcMethod::ObjcMethod):
3324 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3325 (KJS::Bindings::ObjcMethod::operator=):
3326 * bindings/objc/objc_runtime.mm: Added.
3327 (ObjcMethod::ObjcMethod):
3329 (ObjcMethod::numParameters):
3330 (ObjcMethod::getMethodSignature):
3331 (ObjcField::ObjcField):
3334 (ObjcField::valueFromInstance):
3335 (ObjcField::setValueToInstance):
3336 * bindings/objc/objc_utility.h: Added.
3338 * bindings/objc/objc_utility.mm: Added.
3339 (KJS::Bindings::JSMethodNameToObjCMethodName):
3340 (KJS::Bindings::convertValueToObjcValue):
3341 (KJS::Bindings::convertObjcValueToValue):
3342 (KJS::Bindings::objcValueTypeForType):
3343 * bindings/runtime.cpp:
3344 (MethodList::MethodList):
3345 (MethodList::operator=):
3346 (Instance::setValueOfField):
3347 (Instance::createBindingForLanguageInstance):
3348 (Instance::createRuntimeObject):
3349 * bindings/runtime.h:
3350 * bindings/runtime_method.cpp:
3351 (RuntimeMethodImp::RuntimeMethodImp):
3352 (RuntimeMethodImp::get):
3353 (RuntimeMethodImp::call):
3354 * bindings/runtime_method.h:
3355 * bindings/runtime_object.cpp:
3356 (RuntimeObjectImp::get):
3357 (RuntimeObjectImp::hasProperty):
3358 * bindings/test.js: Added.
3359 * bindings/testbindings.mm: Added.
3360 (-[MySecondInterface init]):
3361 (-[MyFirstInterface init]):
3362 (-[MyFirstInterface dealloc]):
3363 (+[MyFirstInterface JavaScriptNameForSelector:]):
3364 (-[MyFirstInterface getInt]):
3365 (-[MyFirstInterface setInt:]):
3366 (-[MyFirstInterface getMySecondInterface]):
3367 (-[MyFirstInterface logMessage:]):
3368 (GlobalImp::className):
3369 (readJavaScriptFromFile):
3374 2004-02-08 Darin Adler <darin@apple.com>
3378 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3380 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3381 macros from working right in C++ code that uses the <cctype> header.
3384 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3385 (KJS::UTF8SequenceLengthNonASCII): Added.
3386 (KJS::inlineUTF8SequenceLength): Added.
3387 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3388 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3389 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3390 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3391 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3393 - fixed the test program so it won't hit the interpreter lock assertion
3395 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3399 2004-02-06 Richard Williamson <rjw@apple.com>
3401 Fixed 3550242 and 3546977. The first diff prevents an assert from firing. The second diff prevents a JavaScript exception, caused be an invalid conversion, which has a downstream consequence of preventing a valid conversion.
3405 * bindings/jni/jni_jsobject.cpp:
3406 (JSObject::toString):
3407 * bindings/jni/jni_utility.cpp:
3408 (KJS::Bindings::convertValueToJValue):
3410 2004-02-02 Darin Adler <darin@apple.com>
3414 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3416 * kjs/array_object.cpp:
3417 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3418 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3419 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3420 number is out of range. This prevents new Array(-1) from causing trouble.
3422 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3424 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3425 casting to int. Results now match those in other browsers.
3427 2004-02-02 Darin Adler <darin@apple.com>
3431 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3432 - fixed other related overflow issues
3434 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3436 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3437 must not restrict values to the range of a particular integer type.
3438 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3439 proper handling for negative results from fmod.
3440 (ValueImp::toUInt32): Ditto.
3441 (ValueImp::toUInt16): Ditto.
3442 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3444 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3445 out-of-integer-range values better in the slice function.
3446 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3447 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3448 out-of-integer-range values better in the toString function.
3449 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3450 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3451 and substr functions.
3455 2004-01-30 Richard Williamson <rjw@apple.com>
3457 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3461 * bindings/jni/jni_instance.cpp:
3462 (JavaInstance::stringValue):
3464 2004-01-26 Darin Adler <darin@apple.com>
3466 * Makefile.am: Switch from pbxbuild to xcodebuild.
3468 2004-01-22 Richard Williamson <rjw@apple.com>
3470 Added stubs for ObjC language binding to JavaScript.
3472 * JavaScriptCore.pbproj/project.pbxproj:
3473 * bindings/jni/jni_runtime.h:
3474 * bindings/objc/objc_runtime.h: Added.
3475 (KJS::Bindings::ObjcParameter::ObjcParameter):
3476 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3477 (KJS::Bindings::ObjcParameter::operator=):
3478 (KJS::Bindings::ObjcParameter::type):
3479 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3480 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3481 (KJS::Bindings::ObjcConstructor::_commonCopy):
3482 (KJS::Bindings::ObjcConstructor::operator=):
3483 (KJS::Bindings::ObjcConstructor::value):
3484 (KJS::Bindings::ObjcConstructor::parameterAt):
3485 (KJS::Bindings::ObjcConstructor::numParameters):
3486 (KJS::Bindings::ObjcField::ObjcField):
3487 (KJS::Bindings::ObjcField::~ObjcField):
3488 * bindings/runtime.h:
3490 2004-01-22 Richard Williamson <rjw@apple.com>
3492 Simplified JavaString by using UString as backing store. This
3493 revealed a bug in CString's assignment operator which I fixed.
3495 Removed some dead code.
3499 * bindings/jni/jni_runtime.h:
3500 (KJS::Bindings::JavaString::JavaString):
3501 (KJS::Bindings::JavaString::_commonInit):
3502 (KJS::Bindings::JavaString::UTF8String):
3503 (KJS::Bindings::JavaString::uchars):
3504 (KJS::Bindings::JavaString::length):
3505 (KJS::Bindings::JavaString::ustring):
3506 * bindings/runtime_object.cpp:
3507 (RuntimeObjectImp::RuntimeObjectImp):
3508 * bindings/runtime_object.h:
3510 (KJS::CString::CString):
3511 (KJS::CString::operator=):
3517 2004-01-16 Richard Williamson <rjw@apple.com>
3519 Fixed 3525853. We weren't handling mapping to overloaded Java
3520 methods very well. Even though this is undefined the other
3521 browsers support it. Also fixed a bug with returning arrays
3522 from Java functions.
3526 * bindings/jni/jni_class.cpp:
3527 (JavaClass::_commonInit):
3528 (JavaClass::methodsNamed):
3529 * bindings/jni/jni_class.h:
3530 * bindings/jni/jni_instance.cpp:
3531 (JavaInstance::invokeMethod):
3532 * bindings/jni/jni_instance.h:
3533 * bindings/jni/jni_runtime.cpp:
3534 (JavaArray::convertJObjectToArray):
3535 (JavaField::valueFromInstance):
3536 (JavaMethod::signature):
3537 (JavaArray::valueAt):
3538 * bindings/jni/jni_runtime.h:
3539 * bindings/jni_jsobject.cpp:
3541 (JSObject::convertJObjectToValue):
3542 * bindings/runtime.cpp:
3543 (MethodList::addMethod):
3544 (MethodList::length):
3545 (MethodList::methodAt):
3546 (MethodList::~MethodList):
3547 * bindings/runtime.h:
3548 (KJS::Bindings::MethodList::MethodList):
3549 * bindings/runtime_method.cpp:
3550 (RuntimeMethodImp::RuntimeMethodImp):
3551 (RuntimeMethodImp::get):
3552 (RuntimeMethodImp::call):
3553 * bindings/runtime_method.h:
3554 * bindings/runtime_object.cpp:
3555 (RuntimeObjectImp::get):
3556 (RuntimeObjectImp::hasProperty):
3558 2004-01-16 Richard Williamson <rjw@apple.com>
3560 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3561 protection implemented for 3530401.
3565 * bindings/runtime_method.cpp:
3566 (RuntimeMethodImp::call):
3568 2004-01-15 Richard Williamson <rjw@apple.com>
3570 Fixed 3530401. JNI doesn't cleanup local refs created on the
3571 main thread. IMO this is a bad bug in our JMI implementation.
3573 To work-around the problem I explicitly delete all local refs.
3574 Further, I've added Push/PopLocalFrame calls to catch any refs
3575 that I may have missed. This will guarantee that we don't leak
3576 any Java references.
3580 * bindings/jni/jni_class.cpp:
3581 (JavaClass::_commonInit):
3582 (JavaClass::JavaClass):
3583 * bindings/jni/jni_instance.cpp:
3584 (JavaInstance::begin):
3585 (JavaInstance::end):
3586 * bindings/jni/jni_instance.h:
3587 * bindings/jni/jni_runtime.cpp:
3588 (JavaConstructor::JavaConstructor):
3589 (JavaMethod::JavaMethod):
3590 * bindings/jni_jsobject.cpp:
3591 (JSObject::listFromJArray):
3592 * bindings/runtime.h:
3593 (KJS::Bindings::Instance::begin):
3594 (KJS::Bindings::Instance::end):
3595 * bindings/runtime_object.cpp:
3596 (RuntimeObjectImp::get):
3597 (RuntimeObjectImp::put):
3598 (RuntimeObjectImp::canPut):
3599 (RuntimeObjectImp::hasProperty):
3600 (RuntimeObjectImp::defaultValue):
3602 2004-01-15 Vicki Murley <vicki@apple.com>
3606 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3608 2004-01-14 Richard Williamson <rjw@apple.com>
3610 Fixed 3529466. With recent changes to Java plugin we must no
3611 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3615 * bindings/jni/jni_instance.cpp:
3616 (JObjectWrapper::JObjectWrapper):
3620 2004-01-14 Richard Williamson <rjw@apple.com>
3624 Finalize may be called on an JSObject after we've already remove all our references. The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about. The fix is to check in finalize that we're getting a call on an instance that we still care about.
3628 * bindings/jni_jsobject.cpp:
3630 (removeJavaReference):
3631 (RootObject::removeAllJavaReferencesForRoot):
3634 2004-01-13 Richard Williamson <rjw@apple.com>
3638 The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable. It is set and retained once and should not be released. Unfortunately is it being released when the 'root' object on a LiveConnect applet is released. This has the symptom of eventually causing an deallocation of the main run loop! Usually after about 5 instantiations/destructions of a LiveConnect applet. The CFRelease of the run loop was removed.
3642 * bindings/jni_jsobject.h:
3643 (KJS::Bindings::RootObject::~RootObject):
3649 2004-01-06 Richard Williamson <rjw@apple.com>
3651 Fixed 3521814. Finalize messages weren't being dispatched!
3655 * bindings/jni_jsobject.cpp:
3658 2004-01-05 Richard Williamson <rjw@apple.com>
3660 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
3661 described by 3515579.
3663 Also cleanup up logging of Java exceptions.
3667 * bindings/jni/jni_class.cpp:
3668 (JavaClass::classForInstance):
3669 * bindings/jni/jni_instance.cpp:
3670 (JavaInstance::JavaInstance):
3671 (JavaInstance::getClass):
3672 (JavaInstance::invokeMethod):
3673 (JObjectWrapper::JObjectWrapper):
3674 (JObjectWrapper::~JObjectWrapper):
3675 * bindings/jni/jni_instance.h:
3676 (KJS::Bindings::JavaInstance::operator=):
3677 * bindings/jni/jni_runtime.cpp:
3678 (JavaMethod::JavaMethod):
3679 (JavaMethod::methodID):
3680 * bindings/jni/jni_runtime.h:
3681 (KJS::Bindings::JavaMethod::JavaMethod):
3682 * bindings/jni/jni_utility.cpp:
3686 (KJS::Bindings::getMethodID):
3687 (KJS::Bindings::callJNIVoidMethodIDA):
3688 (KJS::Bindings::callJNIObjectMethodIDA):
3689 (KJS::Bindings::callJNIByteMethodIDA):
3690 (KJS::Bindings::callJNICharMethodIDA):
3691 (KJS::Bindings::callJNIShortMethodIDA):
3692 (KJS::Bindings::callJNIIntMethodIDA):
3693 (KJS::Bindings::callJNILongMethodIDA):
3694 (KJS::Bindings::callJNIFloatMethodIDA):
3695 (KJS::Bindings::callJNIDoubleMethodIDA):
3696 (KJS::Bindings::callJNIBooleanMethodIDA):
3697 (KJS::Bindings::getCharactersFromJStringInEnv):
3698 (KJS::Bindings::getUCharactersFromJStringInEnv):
3699 (KJS::Bindings::getJNIField):
3700 * bindings/jni/jni_utility.h:
3702 l2003-12-23 John Sullivan <sullivan@apple.com>
3704 * JavaScriptCore.pbproj/project.pbxproj:
3705 Xcode version wars, harmless
3707 2003-12-23 Darin Adler <darin@apple.com>
3709 Reviewed by John (concept, not code, which is just the old code coming back).
3711 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
3713 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
3714 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
3716 2003-12-19 Richard Williamson <rjw@apple.com>
3718 Fixed 3515597. When an error occurs we need
3719 to make sure result values are zeroed.
3721 Cleaned up logs by adding a newline.
3725 * bindings/jni/jni_utility.cpp:
3726 (KJS::Bindings::getJavaVM):
3727 (KJS::Bindings::getJNIEnv):
3730 (KJS::Bindings::getJNIField):
3731 * bindings/jni_jsobject.cpp:
3732 (JSObject::convertValueToJObject):
3736 2003-12-17 Richard Williamson <rjw@apple.com>
3738 Ensure that all the symbols we export are in the KJS
3739 namespace (3512245).
3741 Also renamed JavaString.characters() to JavaString.UTF8String()
3742 for enhanced clarity.
3744 Added some sanity checking to constructor of JObjectWrapper.
3749 * bindings/jni/jni_class.cpp:
3750 * bindings/jni/jni_class.h:
3751 * bindings/jni/jni_instance.cpp:
3752 (JavaInstance::invokeMethod):
3753 (JObjectWrapper::JObjectWrapper):
3754 * bindings/jni/jni_instance.h:
3755 * bindings/jni/jni_runtime.cpp:
3756 (JavaParameter::JavaParameter):
3757 (JavaField::JavaField):
3758 (JavaMethod::JavaMethod):
3759 (JavaMethod::signature):
3760 * bindings/jni/jni_runtime.h:
3761 (KJS::Bindings::JavaString::ascii):
3762 (KJS::Bindings::JavaString::UTF8String):
3763 (KJS::Bindings::JavaString::JavaString):
3764 (KJS::Bindings::JavaString::_commonInit):
3765 (KJS::Bindings::JavaString::uchars):
3766 (KJS::Bindings::JavaString::length):
3767 (KJS::Bindings::JavaString::ustring):
3768 (KJS::Bindings::JavaParameter::type):
3769 (KJS::Bindings::JavaField::name):
3770 (KJS::Bindings::JavaField::type):
3771 (KJS::Bindings::JavaMethod::name):
3772 (KJS::Bindings::JavaMethod::returnType):
3773 * bindings/jni/jni_utility.cpp:
3774 (KJS::Bindings::getJavaVM):
3775 (KJS::Bindings::getJNIEnv):
3776 (KJS::Bindings::callJNIVoidMethod):
3777 (KJS::Bindings::callJNIObjectMethod):
3778 (KJS::Bindings::callJNIBooleanMethod):
3779 (KJS::Bindings::callJNIByteMethod):
3780 (KJS::Bindings::callJNICharMethod):
3781 (KJS::Bindings::callJNIShortMethod):
3782 (KJS::Bindings::callJNIIntMethod):
3783 (KJS::Bindings::callJNILongMethod):
3784 (KJS::Bindings::callJNIFloatMethod):
3785 (KJS::Bindings::callJNIDoubleMethod):
3786 (KJS::Bindings::callJNIVoidMethodA):
3787 (KJS::Bindings::callJNIObjectMethodA):
3788 (KJS::Bindings::callJNIByteMethodA):
3789 (KJS::Bindings::callJNICharMethodA):
3790 (KJS::Bindings::callJNIShortMethodA):
3791 (KJS::Bindings::callJNIIntMethodA):
3792 (KJS::Bindings::callJNILongMethodA):
3793 (KJS::Bindings::callJNIFloatMethodA):
3794 (KJS::Bindings::callJNIDoubleMethodA):
3795 (KJS::Bindings::callJNIBooleanMethodA):
3796 (KJS::Bindings::getCharactersFromJString):
3797 (KJS::Bindings::releaseCharactersForJString):
3798 (KJS::Bindings::getCharactersFromJStringInEnv):
3799 (KJS::Bindings::releaseCharactersForJStringInEnv):
3800 (KJS::Bindings::getUCharactersFromJStringInEnv):
3801 (KJS::Bindings::releaseUCharactersForJStringInEnv):
3802 (KJS::Bindings::JNITypeFromClassName):
3803 (KJS::Bindings::signatureFromPrimitiveType):
3804 (KJS::Bindings::JNITypeFromPrimitiveType):
3805 (KJS::Bindings::getJNIField):
3806 (KJS::Bindings::convertValueToJValue):
3807 * bindings/jni/jni_utility.h:
3808 * bindings/jni_jsobject.cpp:
3809 (KJS::Bindings::JSObject::invoke):
3810 (KJS::Bindings::JSObject::JSObject):
3811 (KJS::Bindings::JSObject::call):
3812 (KJS::Bindings::JSObject::eval):
3813 (KJS::Bindings::JSObject::getMember):
3814 (KJS::Bindings::JSObject::setMember):
3815 (KJS::Bindings::JSObject::removeMember):
3816 (KJS::Bindings::JSObject::getSlot):
3817 (KJS::Bindings::JSObject::setSlot):
3818 (KJS::Bindings::JSObject::toString):
3819 (KJS::Bindings::JSObject::finalize):
3820 (KJS::Bindings::JSObject::createNative):
3821 (KJS::Bindings::JSObject::convertValueToJObject):
3822 (KJS::Bindings::JSObject::convertJObjectToValue):
3823 (KJS::Bindings::JSObject::listFromJArray):
3824 * bindings/jni_jsobject.h:
3825 * bindings/runtime.cpp:
3826 * bindings/runtime.h:
3827 * bindings/runtime_method.cpp:
3828 * bindings/runtime_method.h:
3832 2003-12-16 Richard Williamson <rjw@apple.com>
3834 Ack! More assertions. Lock ALL entry points into the interpreter!
3839 * bindings/jni_jsobject.cpp:
3840 (Bindings::JSObject::call):
3841 (Bindings::JSObject::eval):
3842 (Bindings::JSObject::getMember):
3843 (Bindings::JSObject::setMember):
3844 (Bindings::JSObject::removeMember):
3845 (Bindings::JSObject::getSlot):
3846 (Bindings::JSObject::setSlot):
3847 (Bindings::JSObject::convertJObjectToValue):
3849 2003-12-15 Richard Williamson <rjw@apple.com>
3851 Fixed a couple of snafus and removed some logging.
3855 * bindings/jni_jsobject.cpp:
3856 (Bindings::performJavaScriptAccess):
3857 (Bindings::completedJavaScriptAccess):
3858 (Bindings::dispatchToJavaScriptThread):
3859 Removed some annoying JS_LOG clutter.
3861 (Bindings::RootObject::removeAllJavaReferencesForRoot):
3862 Fixed allocation of key buffer that was called after it was needed.
3864 (Bindings::JSObject::invoke):
3865 (Bindings::JSObject::JSObject):
3866 (Bindings::JSObject::getMember):
3867 (Bindings::JSObject::getSlot):
3868 Added additional interpreter locks around getMember and getSlot.
3869 These functions may cause allocation of JS impls.
3871 2003-12-15 Richard Williamson <rjw@apple.com>
3873 args weren't passed to 'call' invocation. d'oh.
3874 lock interpreter when we create instances of JS impls.
3878 * bindings/jni_jsobject.cpp:
3879 (Bindings::JSObject::call):
3880 (Bindings::JSObject::eval):
3881 (Bindings::JSObject::getMember):
3882 (Bindings::JSObject::setMember):
3883 (Bindings::JSObject::getSlot):
3884 (Bindings::JSObject::convertValueToJObject):
3885 (Bindings::JSObject::convertJObjectToValue):
3886 (Bindings::JSObject::listFromJArray):
3887 * bindings/jni_jsobject.h:
3889 2003-12-15 Richard Williamson <rjw@apple.com>
3891 Last piece of LiveConnect! This checkin adds implementation
3892 of the Java to JavaScript object conversion functions.
3896 * bindings/jni/jni_instance.cpp:
3897 (JavaInstance::invokeMethod):
3898 * bindings/jni/jni_utility.cpp:
3899 * bindings/jni/jni_utility.h:
3900 * bindings/jni_jsobject.cpp:
3901 (Bindings::JSObject::invoke):
3902 (Bindings::JSObject::call):
3903 (Bindings::JSObject::eval):
3904 (Bindings::JSObject::getMember):
3905 (Bindings::JSObject::setMember):
3906 (Bindings::JSObject::getSlot):
3907 (Bindings::JSObject::setSlot):
3908 (Bindings::JSObject::createNative):
3909 (Bindings::JSObject::convertValueToJObject):
3910 (Bindings::JSObject::convertJObjectToValue):
3911 (Bindings::JSObject::listFromJArray):
3912 * bindings/jni_jsobject.h:
3914 * bindings/runtime_method.cpp:
3915 (RuntimeMethodImp::get):
3916 (RuntimeMethodImp::codeType):
3917 (RuntimeMethodImp::execute):
3919 2003-12-12 Richard Williamson <rjw@apple.com>
3921 Added implementation of stubs in JSObject. All that
3922 remains is a couple of simple conversion functions stubs and
3923 we're done with LiveConnect. Also, changed string passing to
3924 JS to use uchars instead of chars.
3928 * bindings/jni/jni_runtime.h:
3929 (Bindings::JavaString::JavaString):
3930 (Bindings::JavaString::_commonInit):
3931 (Bindings::JavaString::_commonCopy):
3932 (Bindings::JavaString::_commonDelete):
3933 (Bindings::JavaString::~JavaString):
3934 (Bindings::JavaString::operator=):
3935 (Bindings::JavaString::uchars):
3936 (Bindings::JavaString::length):
3937 (Bindings::JavaString::ustring):
3938 * bindings/jni/jni_utility.cpp:
3939 (getUCharactersFromJStringInEnv):
3940 (releaseUCharactersForJStringInEnv):
3941 (convertValueToJObject):
3942 (convertJObjectToValue):
3943 * bindings/jni/jni_utility.h:
3944 * bindings/jni_jsobject.cpp:
3945 (Bindings::JSObject::invoke):
3946 (Bindings::JSObject::call):
3947 (Bindings::JSObject::eval):
3948 (Bindings::JSObject::getMember):
3949 (Bindings::JSObject::setMember):
3950 (Bindings::JSObject::removeMember):
3951 (Bindings::JSObject::getSlot):
3952 (Bindings::JSObject::setSlot):
3953 * bindings/jni_jsobject.h:
3955 2003-12-12 Richard Williamson <rjw@apple.com>
3957 Ensure that all calls from Java into JavaScript are
3958 performed on a designated thread (the main thread).
3962 * bindings/jni_jsobject.cpp:
3963 (isJavaScriptThread):
3965 (Bindings::performJavaScriptAccess):
3966 (Bindings::completedJavaScriptAccess):
3967 (Bindings::initializeJavaScriptAccessLock):
3968 (Bindings::lockJavaScriptAccess):
3969 (Bindings::unlockJavaScriptAccess):
3970 (Bindings::dispatchToJavaScriptThread):
3971 (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
3972 (Bindings::RootObject::removeAllJavaReferencesForRoot):
3973 (Bindings::JSObject::invoke):
3974 (Bindings::JSObject::JSObject):
3975 (Bindings::JSObject::call):
3976 (Bindings::JSObject::eval):
3977 (Bindings::JSObject::getMember):
3978 (Bindings::JSObject::setMember):
3979 (Bindings::JSObject::removeMember):
3980 (Bindings::JSObject::getSlot):
3981 (Bindings::JSObject::setSlot):
3982 (Bindings::JSObject::toString):
3983 (Bindings::JSObject::finalize):
3984 (Bindings::JSObject::getWindow):
3985 * bindings/jni_jsobject.h:
3986 (Bindings::RootObject::~RootObject):
3987 (Bindings::RootObject::findRootObjectForNativeHandleFunction):
3988 (Bindings::RootObject::runLoop):
3989 (Bindings::RootObject::performJavaScriptSource):
3992 2003-12-11 Richard Williamson <rjw@apple.com>
3994 Added support for calling a JavaScript function from
3995 Java. Right now this only works for void func(void)
3996 functions, but the conversion of args and return values
3999 Cleaned up and verified reference counting scheme, and
4000 dereferencing of vended JavaScript objects when applet is
4001 destroyed (actually when part is destroyed).
4003 Removed link hack for testkjs now that the Java folks think
4004 they have a solution for the 1.4.2 JavaVM link problem. Although
4005 Greg B. thinks his solution may cause problems for the 1.3.1
4006 version of the VM!?!
4011 * bindings/jni/jni_runtime.h:
4012 (Bindings::JavaString::JavaString):
4013 * bindings/jni/jni_utility.cpp:
4014 (convertValueToJValue):
4015 (convertValueToJObject):
4017 * bindings/jni/jni_utility.h:
4018 * bindings/jni_jsobject.cpp:
4019 (KJS_setFindRootObjectForNativeHandleFunction):
4020 (KJS_findRootObjectForNativeHandleFunction):
4021 (getReferencesByRootDictionary):
4022 (getReferencesDictionary):
4023 (findReferenceDictionary):
4026 (removeJavaReference):
4027 * bindings/jni_jsobject.h:
4028 (Bindings::RootObject::RootObject):
4029 (Bindings::RootObject::~RootObject):
4030 (Bindings::RootObject::setRootObjectImp):
4031 (Bindings::RootObject::rootObjectImp):
4032 (Bindings::RootObject::setInterpreter):
4033 (Bindings::RootObject::interpreter):
4037 2003-12-10 Darin Adler <darin@apple.com>
4041 - fixed regression in JavaScript tests reported by the KDE guys
4042 - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
4044 * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
4046 (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
4047 tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
4048 and binary compatibility than default parameter values.
4049 (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
4051 * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
4052 "tolerate empty string" parameter.
4054 2003-12-10 Richard Williamson <rjw@apple.com>
4056 Added code to manage reference counting of JavaScript
4057 objects passed to Java. Also added implementation of
4058 KJS_JSCreateNativeJSObject. This is the function that
4059 provides the root object to Java (KJS::Window).
4063 * JavaScriptCore.pbproj/project.pbxproj:
4064 * bindings/jni_jsobject.cpp:
4065 (KJS_setFindObjectForNativeHandleFunction):
4066 (KJS_findObjectForNativeHandleFunction):
4067 (getReferencesByOwnerDictionary):
4068 (getReferencesDictionary):
4069 (findReferenceDictionary):
4071 (removeJavaReference):
4072 (removeAllJavaReferencesForOwner):
4073 * bindings/jni_jsobject.h:
4075 2003-12-09 Richard Williamson <rjw@apple.com>
4077 LiveConnect stubs that correspond to the native methods
4078 on JSObject. These will be called from the new Java plugin
4079 when an instance of JSObject is instantiated and messaged.
4080 When these are implemented the Java will be able to originate
4081 calls into JavaScript.
4083 Also a temporary work-around added to Makefile.am to solve
4084 a link problem. The 1.4.2 JavaVM accidentally links against
4085 libobjc. This call a failure linking testkjs. Mike Hay is
4086 working with someone to fix the problem (3505587).
4090 * JavaScriptCore.pbproj/project.pbxproj:
4092 * bindings/jni_jsobject.cpp: Added.
4093 (KJS_JSCreateNativeJSObject):
4094 (KJS_JSObject_JSFinalize):
4095 (KJS_JSObject_JSObjectCall):
4096 (KJS_JSObject_JSObjectEval):
4097 (KJS_JSObject_JSObjectGetMember):
4098 (KJS_JSObject_JSObjectSetMember):
4099 (KJS_JSObject_JSObjectRemoveMember):
4100 (KJS_JSObject_JSObjectGetSlot):
4101 (KJS_JSObject_JSObjectSetSlot):
4102 (KJS_JSObject_JSObjectToString):
4103 * bindings/jni_jsobject.h: Added.
4105 2003-12-09 Maciej Stachowiak <mjs@apple.com>
4109 <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
4111 * kjs/collector.cpp:
4112 (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
4113 (KJS::Collector::collect): likewise
4115 2003-12-08 Richard Williamson <rjw@apple.com>
4117 LiveConnect: The last piece of the JavaScript side of the
4118 LiveConnect implementation. This change adds support for
4119 setting/getting values from Java arrays in JavaScript.
4123 * bindings/jni/jni_instance.h:
4124 * bindings/jni/jni_runtime.cpp:
4125 (JavaField::JavaField):
4126 (convertJObjectToArray):
4127 (JavaArray::JavaArray):
4128 (JavaArray::~JavaArray):
4129 (JavaArray::setValueAt):
4130 (JavaArray::valueAt):
4131 (JavaArray::getLength):
4132 * bindings/jni/jni_runtime.h:
4133 (Bindings::JavaArray::operator=):
4134 (Bindings::JavaArray::javaArray):
4135 * bindings/jni/jni_utility.cpp:
4136 (JNITypeFromPrimitiveType):
4137 (convertValueToJValue):
4138 * bindings/jni/jni_utility.h:
4139 * bindings/runtime.h:
4140 * bindings/runtime_array.cpp:
4141 (RuntimeArrayImp::RuntimeArrayImp):
4142 (RuntimeArrayImp::~RuntimeArrayImp):
4143 (RuntimeArrayImp::get):
4144 (RuntimeArrayImp::put):
4145 (RuntimeArrayImp::hasProperty):
4146 * bindings/runtime_array.h:
4147 (KJS::RuntimeArrayImp::getLength):
4148 (KJS::RuntimeArrayImp::getConcreteArray):
4149 * bindings/runtime_object.cpp:
4150 (RuntimeObjectImp::get):
4151 (RuntimeObjectImp::canPut):
4152 (RuntimeObjectImp::hasProperty):
4154 2003-12-05 Richard Williamson <rjw@apple.com>
4156 LiveConnect: Part 1 of supporting JS bindings to
4157 native language arrays.
4161 * JavaScriptCore.pbproj/project.pbxproj:
4162 * bindings/jni/jni_runtime.cpp:
4163 (JavaField::JavaField):
4164 (convertJObjectToArray):
4165 (JavaField::valueFromInstance):
4166 (JavaField::setValueToInstance):
4167 * bindings/jni/jni_runtime.h:
4168 * bindings/runtime.cpp:
4169 (Instance::setValueOfField):
4170 * bindings/runtime.h:
4171 (Bindings::Array::~Array):
4173 2003-12-04 Richard Williamson <rjw@apple.com>
4175 LiveConnect: Moved defaultValue into concrete implementation because
4176 more intelligent conversion can be perform with knowledge
4177 of the class of the original instance.
4181 * bindings/jni/jni_class.cpp:
4182 (JavaClass::isNumberClass):
4183 (JavaClass::isBooleanClass):
4184 (JavaClass::isStringClass):
4185 * bindings/jni/jni_class.h:
4186 * bindings/jni/jni_instance.cpp:
4187 (JavaInstance::defaultValue):
4188 (JavaInstance::valueOf):
4189 * bindings/jni/jni_instance.h:
4190 (Bindings::JavaInstance::javaInstance):
4191 * bindings/runtime.h:
4192 * bindings/runtime_object.cpp:
4193 (RuntimeObjectImp::defaultValue):
4195 2003-12-04 Richard Williamson <rjw@apple.com>
4197 LiveConnect: Added support for setting the value of Java
4202 * bindings/jni/jni_instance.cpp:
4203 (JavaInstance::invokeMethod):
4204 * bindings/jni/jni_runtime.cpp:
4205 (JavaParameter::JavaParameter):
4206 (JavaField::JavaField):