1 2005-04-11 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
7 - Avoid using protected values hash for the two most common cases
8 - Bump up ListImp high water mark, new testing shows 508 ListImps are
9 created during JS iBench.
11 Net result is a 5.6% speedup on JavaScript iBench
14 (KJS::Collector::collect): mark protected lists as appropriate.
17 (KJS::ListImp::markValues): Moved implementation from List::markValues
18 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
20 (KJS::allocateListImp): link lists outside the pool into a separate
21 doubly linked list to be able to mark protected lists
22 (KJS::deallocateListImp): do the corresponding delinking
23 (KJS::List::derefValues): do nothing in conservative GC mode
24 (KJS::List::refValues): do nothing in conservative GC mode
25 (KJS::List::markValues): call ListImp version
41 2005-03-16 Jens Alfke <jens@apple.com>
45 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
46 JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
47 In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
48 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
51 (KJS::GlobalFuncImp::call):
53 2005-03-15 Richard Williamson <rjw@apple.com>
55 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
57 Added JavaScript boolean to type that can be converted to
58 ObjC scalar parameters.
60 Reviewed by Ken Kocienda.
62 * bindings/objc/objc_utility.mm:
63 (KJS::Bindings::convertValueToObjcValue):
79 2005-02-21 Darin Adler <darin@apple.com>
81 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
83 2005-02-17 Richard Williamson <rjw@apple.com>
85 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
89 Reviewed by John Sullivan.
91 * bindings/jni/jni_runtime.cpp:
92 (JavaField::valueFromInstance):
96 2005-02-11 Richard Williamson <rjw@apple.com>
98 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
100 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
101 creates these wrappers. The WebCore subclass of the interpreter now overrides
102 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
106 * bindings/c/c_utility.cpp:
107 (convertValueToNPVariant):
108 * bindings/jni/jni_instance.cpp:
109 (JavaInstance::invokeMethod):
110 * bindings/jni/jni_objc.mm:
111 (KJS::Bindings::dispatchJNICall):
112 * bindings/jni/jni_runtime.cpp:
113 (JavaField::valueFromInstance):
114 (JavaArray::valueAt):
115 * bindings/objc/WebScriptObject.mm:
116 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
117 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
118 * bindings/objc/WebScriptObjectPrivate.h:
119 * bindings/objc/objc_utility.h:
120 * bindings/objc/objc_utility.mm:
121 (KJS::Bindings::convertObjcValueToValue):
122 (KJS::Bindings::createObjcInstanceForValue):
123 * bindings/runtime.cpp:
124 (Instance::createBindingForLanguageInstance):
125 (Instance::createRuntimeObject):
126 (Instance::createLanguageInstanceForValue):
127 * bindings/runtime.h:
128 * kjs/interpreter.cpp:
129 (Interpreter::createLanguageInstanceForValue):
134 2005-02-10 Darin Adler <darin@apple.com>
136 "Reviewed" by Richard (he told me the file was obsolete).
138 - got rid of an obsolete file
140 * bindings/npsap.h: Removed.
146 2005-02-03 Richard Williamson <rjw@apple.com>
148 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
150 Revert to old (and correct) behavior of returning runtime object
151 when passed as a parameter, rather than it's corresponding DOM
156 * bindings/objc/WebScriptObject.mm:
157 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
161 2005-01-28 Richard Williamson <rjw@apple.com>
163 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
165 Only use special 'back door' property to get the runtime object if thisObj isn't
166 already a runtime object.
168 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
169 ClassInfo pointer instead.
173 * bindings/c/c_utility.cpp:
174 (convertValueToNPVariant):
175 * bindings/objc/WebScriptObject.mm:
176 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
177 * bindings/runtime_method.cpp:
178 (RuntimeMethodImp::call):
182 2005-01-26 Richard Williamson <rjw@apple.com>
184 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
186 I added a member variable to ObjectImp. This changed it's size and consequently
187 hampered the optimizations built into the garbage collector. Objects no longer
188 fit within the allocators cell size, and thus allocation fell back to a slower
191 As a result of this fix I also dramatically cleaned up how runtime objects are
192 accessed. The path mostly *removes* code.
196 * bindings/runtime_method.cpp:
197 (RuntimeMethodImp::call):
198 * bindings/runtime_object.cpp:
199 (RuntimeObjectImp::get):
200 (RuntimeObjectImp::put):
201 (RuntimeObjectImp::canPut):
202 (RuntimeObjectImp::hasProperty):
203 (RuntimeObjectImp::defaultValue):
204 * bindings/runtime_object.h:
206 (KJS::ObjectImp::ObjectImp):
209 2005-01-20 Darin Adler <darin@apple.com>
211 Reviewed by me, changes by Han Ming Ong.
213 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
215 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
216 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
218 2005-01-20 Richard Williamson <rjw@apple.com>
220 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
222 The comprehensive fix for this problem requires new API, as described in 3965326. However,
223 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
224 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
225 implemented on the bound object.
229 * bindings/objc/objc_runtime.h:
230 * bindings/objc/objc_runtime.mm:
231 (ObjcFallbackObjectImp::type):
232 (ObjcFallbackObjectImp::implementsCall):
233 (ObjcFallbackObjectImp::toBoolean):
234 * bindings/testbindings.mm:
235 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
236 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
240 2005-01-19 Richard Williamson <rjw@apple.com>
242 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
244 Fixed the following problems with LiveConnect that are demonstrated by the application
245 described in 3853676.
247 1. If a nil object is passed in an array from Java to JavaScript we will crash.
248 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
249 3. We will sometimes fail to find the correct static method ID.
253 * bindings/jni/jni_jsobject.cpp:
254 (JSObject::convertJObjectToValue):
255 (JSObject::listFromJArray):
256 * bindings/jni/jni_runtime.cpp:
257 (JavaField::valueFromInstance):
258 (JavaField::setValueToInstance):
259 * bindings/jni/jni_utility.cpp:
260 (KJS::Bindings::getMethodID):
261 (KJS::Bindings::convertValueToJValue):
262 * bindings/runtime_array.h:
264 2005-01-18 Richard Williamson <rjw@apple.com>
266 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
268 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
269 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
270 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
271 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
273 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
274 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
275 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
279 * bindings/objc/objc_instance.h:
280 * bindings/objc/objc_instance.mm:
281 (ObjcInstance::supportsSetValueOfUndefinedField):
282 * bindings/runtime.h:
283 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
284 * bindings/runtime_object.cpp:
285 (RuntimeObjectImp::RuntimeObjectImp):
286 (RuntimeObjectImp::get):
287 (RuntimeObjectImp::put):
288 (RuntimeObjectImp::canPut):
289 (RuntimeObjectImp::hasProperty):
290 (RuntimeObjectImp::defaultValue):
291 * bindings/runtime_object.h:
292 (KJS::RuntimeObjectImp::fallbackObject):
294 (KJS::ObjectImp::ObjectImp):
296 (KJS::ObjectImp::forwardingScriptMessage):
297 (KJS::ObjectImp::setForwardingScriptMessage):
299 2005-01-18 Richard Williamson <rjw@apple.com>
301 Back out a change that was incorrectly committed yesterday.
305 * bindings/objc/objc_utility.mm:
306 (KJS::Bindings::convertValueToObjcValue):
308 2005-01-17 Richard Williamson <rjw@apple.com>
310 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
312 Keep track of originating execution context and target execution
313 context for native JS object wrappers, and perform appropriate
316 Reviewed by David Harrison.
318 * bindings/NP_jsobject.cpp:
320 (_NPN_CreateScriptObject):
325 (_NPN_RemoveProperty):
329 * bindings/NP_jsobject.h:
330 * bindings/c/c_instance.cpp:
331 (CInstance::CInstance):
332 (CInstance::stringValue):
333 * bindings/c/c_instance.h:
334 * bindings/c/c_utility.cpp:
335 (convertValueToNPVariant):
336 * bindings/jni/jni_instance.cpp:
337 (JavaInstance::JavaInstance):
338 (JavaInstance::valueOf):
339 * bindings/jni/jni_instance.h:
340 * bindings/objc/WebScriptObject.mm:
341 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
342 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
343 (-[WebScriptObject KJS::Bindings::]):
344 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
345 (-[WebScriptObject _isSafeScript]):
346 (-[WebScriptObject callWebScriptMethod:withArguments:]):
347 (-[WebScriptObject evaluateWebScript:]):
348 (-[WebScriptObject setValue:forKey:]):
349 (-[WebScriptObject valueForKey:]):
350 (-[WebScriptObject removeWebScriptKey:]):
351 (-[WebScriptObject stringRepresentation]):
352 (-[WebScriptObject webScriptValueAtIndex:]):
353 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
354 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
355 * bindings/objc/WebScriptObjectPrivate.h:
356 * bindings/objc/objc_instance.h:
357 * bindings/objc/objc_runtime.mm:
358 (convertValueToObjcObject):
359 * bindings/objc/objc_utility.mm:
360 (KJS::Bindings::convertValueToObjcValue):
361 * bindings/runtime.cpp:
362 (Instance::Instance):
363 (Instance::operator=):
364 * bindings/runtime.h:
365 (KJS::Bindings::Instance::Instance):
366 (KJS::Bindings::Instance::setExecutionContext):
367 (KJS::Bindings::Instance::executionContext):
368 * bindings/runtime_root.cpp:
369 (RootObject::setInterpreter):
370 * bindings/runtime_root.h:
372 (KJS::Interpreter::isGlobalObject):
373 (KJS::Interpreter::interpreterForGlobalObject):
374 (KJS::Interpreter::isSafeScript):
378 2005-01-13 Vicki Murley <vicki@apple.com>
382 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
384 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
386 2005-01-12 Richard Williamson <rjw@apple.com>
388 Avoid additional work on dealloc by adding early out to
389 removeNativeReference(). (This will save time on dealloc
390 for all ObjC DOM objects.)
394 * bindings/runtime_root.cpp:
395 (KJS::Bindings::removeNativeReference):
397 2005-01-12 Richard Williamson <rjw@apple.com>
399 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
401 We were always returning the first "root" object for all runtime
402 objects. Changed 0 in loop to i, the index.
404 Reviewed by David Harrison.
406 * bindings/runtime_root.cpp:
407 (KJS::Bindings::rootForImp):
409 2005-01-11 Richard Williamson <rjw@apple.com>
411 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
413 Use the new dispatching API to invoke JNI, rather than calling JNI
416 Reviewed by David Harrison.
418 * bindings/jni/jni_instance.cpp:
419 (JavaInstance::invokeMethod):
420 * bindings/jni/jni_runtime.cpp:
421 (JavaField::dispatchValueFromInstance):
422 (JavaField::valueFromInstance):
423 (JavaField::dispatchSetValueToInstance):
424 (JavaField::setValueToInstance):
425 * bindings/jni/jni_runtime.h:
426 * bindings/jni/jni_utility.cpp:
427 (KJS::Bindings::convertValueToJValue):
435 2004-12-17 Maciej Stachowiak <mjs@apple.com>
439 <rdar://problem/3926869> Opening caches window after running PLT causes crash
441 * kjs/protected_values.cpp:
442 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
443 the protected value table.
444 (KJS::ProtectedValues::increaseProtectCount): Ditto.
445 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
447 2004-12-16 Darin Adler <darin@apple.com>
451 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
453 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
454 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
455 non-locale-specific versions.
456 * kjs/string_object.lut.h: Regenerated.
458 2004-12-14 Richard Williamson <rjw@apple.com>
460 Pass URL of plugin view when call into JNI.
464 * bindings/jni/jni_objc.mm:
465 (KJS::Bindings::dispatchJNICall):
467 2004-12-13 Richard Williamson <rjw@apple.com>
469 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
471 Add support for calling static Java methods from JavaScript.
475 * bindings/jni/jni_instance.cpp:
476 (JavaInstance::invokeMethod):
477 * bindings/jni/jni_runtime.cpp:
478 (JavaMethod::JavaMethod):
479 * bindings/jni/jni_runtime.h:
480 (KJS::Bindings::JavaMethod::isStatic):
481 * bindings/jni/jni_utility.cpp:
482 (callJNIStaticMethod):
483 (KJS::Bindings::callJNIBooleanMethod):
484 (KJS::Bindings::callJNIStaticBooleanMethod):
485 * bindings/jni/jni_utility.h:
487 2004-12-13 Richard Williamson <rjw@apple.com>
489 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
493 * bindings/jni/jni_instance.cpp:
494 (JavaInstance::invokeMethod):
495 * bindings/jni/jni_objc.mm:
496 (KJS::Bindings::dispatchJNICall):
497 * bindings/jni/jni_runtime.h:
498 * bindings/jni/jni_utility.h:
502 2004-12-07 Maciej Stachowiak <mjs@apple.com>
506 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
508 The fix was to implement copy constructor and assignment operator,
509 the ones that worked on the base class did not replace the
513 (KJS::ProtectedValue::ProtectedValue):
514 (KJS::ProtectedValue::operator=):
515 (KJS::ProtectedObject::ProtectedObject):
516 (KJS::ProtectedObject::operator=):
518 Also fixed a bug in the GC test mode that compares the results of
519 the old collector and the new collector.
526 2004-11-23 Richard Williamson <rjw@apple.com>
528 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
532 * bindings/c/c_class.cpp:
533 (CClass::_commonInit):
535 2004-11-21 Maciej Stachowiak <mjs@apple.com>
539 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
542 (KJS::Collector::Thread::Thread):
543 (KJS::destroyRegisteredThread):
544 (KJS::initializeRegisteredThreadKey):
545 (KJS::Collector::registerThread):
546 (KJS::Collector::markStackObjectsConservatively):
547 (KJS::Collector::markCurrentThreadConservatively):
548 (KJS::Collector::markOtherThreadConservatively):
556 2004-11-15 Richard Williamson <rjw@apple.com>
558 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
562 * bindings/objc/objc_instance.mm:
563 (ObjcInstance::stringValue):
564 * bindings/objc/objc_utility.h:
565 * bindings/objc/objc_utility.mm:
566 (KJS::Bindings::convertNSStringToString):
567 (KJS::Bindings::convertObjcValueToValue):
571 2004-11-09 Chris Blumenberg <cblu@apple.com>
573 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
578 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
579 * bindings/softlinking.c: Added.
581 (getFunctionPointer): new
582 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
586 2004-11-04 Darin Adler <darin@apple.com>
590 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
591 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
592 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
593 than allocating a new one
595 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
596 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
597 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
598 actually allocate only the very first time it's called.
599 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
600 shared instance since there can be only one).
601 (-[WebUndefined copyWithZone:]): Ditto.
602 (-[WebUndefined retain]): Ditto.
603 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
605 (-[WebUndefined autorelease]): Simplified to just return self (see above).
606 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
607 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
608 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
609 bug mentioned above).
610 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
611 No need to call init, since that's a no-op for this class.
613 2004-11-03 David Harrison <harrison@apple.com>
617 Eliminate the use of a marker file to determine how to build.
622 2004-11-01 Richard Williamson <rjw@apple.com>
624 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
628 * bindings/c/c_instance.cpp:
629 (CInstance::invokeMethod):
630 (CInstance::invokeDefaultMethod):
631 Initialize out parameters to void type.
633 * bindings/c/c_runtime.cpp:
634 (CField::valueFromInstance):
635 (CField::setValueToInstance):
636 Initialize out parameters to void type.
637 Also added additional checks to protect against classes that
638 don't implement all functions.
640 2004-11-01 Richard Williamson <rjw@apple.com>
642 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
647 * bindings/objc/WebScriptObject.mm:
648 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
649 Added additional conversion Undefined -> WebUndefined.
650 * bindings/objc/objc_utility.mm:
651 (KJS::Bindings::convertObjcValueToValue):
652 Added additional conversion WebUndefined -> Undefined.
654 2004-11-01 Darin Adler <darin@apple.com>
656 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
658 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
659 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
660 report to match the contents of the file.
666 2004-10-22 Ken Kocienda <kocienda@apple.com>
670 * JavaScriptCore.pbproj/project.pbxproj:
671 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
675 2004-10-13 Richard Williamson <rjw@apple.com>
677 Moved boolean checks prior to NSNumber checks. booleans are
680 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
684 * bindings/objc/objc_utility.mm:
685 (KJS::Bindings::convertObjcValueToValue):
687 2004-10-12 Richard Williamson <rjw@apple.com>
689 Fixed access to DOM object via WebScriptObject API.
690 The execution context for DOM objects wasn't being found.
691 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
695 * bindings/objc/WebScriptObject.mm:
697 (-[WebScriptObject KJS::Bindings::]):
698 (-[WebScriptObject callWebScriptMethod:withArguments:]):
699 (-[WebScriptObject evaluateWebScript:]):
700 (-[WebScriptObject setValue:forKey:]):
701 (-[WebScriptObject valueForKey:]):
702 (-[WebScriptObject stringRepresentation]):
703 * bindings/objc/WebScriptObjectPrivate.h:
705 2004-10-09 Darin Adler <darin@apple.com>
709 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
711 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
712 creating an init routine.
714 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
715 require a global constructor that creates an init routine.
717 2004-10-09 Darin Adler <darin@apple.com>
721 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
723 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
724 work with the window object of the page the function is in, not the page of the caller. This
725 is what all other browsers do. This code was hidden before by the "everything is defined on
726 window object" hack in WebCore.
728 2004-10-07 Richard Williamson <rjw@apple.com>
730 Added simple JavaScript call tracing. Very useful for
731 debugging complex pages.
733 Tracing is only available in development builds and is
736 (gdb) set traceJavaScript = 1
740 setTraceJavaScript(true)
742 Function, args, and return values are printed to console. Very
747 * kjs/function_object.cpp:
748 (FunctionProtoFuncImp::call):
754 2004-10-05 Richard Williamson <rjw@apple.com>
756 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
760 * bindings/NP_jsobject.cpp:
762 * bindings/npruntime.cpp:
763 (_NPN_SetExceptionWithUTF8):
764 * bindings/objc/WebScriptObject.mm:
765 (+[WebScriptObject throwException:]):
767 (KJS::InterpreterImp::context):
769 2004-10-05 Richard Williamson <rjw@apple.com>
771 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
775 * bindings/objc/objc_utility.mm:
776 (KJS::Bindings::convertObjcValueToValue):
778 2004-10-04 Darin Adler <darin@apple.com>
782 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
784 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
786 - rolled out an old workaround we don't need any more
788 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
789 required it is no longer there.
791 2004-09-30 Richard Williamson <rjw@apple.com>
793 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
797 * bindings/NP_jsobject.cpp:
801 * bindings/c/c_class.cpp:
802 (CClass::methodsNamed):
803 (CClass::fieldNamed):
804 * bindings/c/c_class.h:
805 * bindings/c/c_instance.cpp:
806 (CInstance::invokeMethod):
807 * bindings/jni/jni_class.cpp:
808 (JavaClass::methodsNamed):
809 * bindings/jni/jni_class.h:
810 * bindings/npruntime.h:
811 * bindings/objc/objc_class.h:
812 * bindings/objc/objc_class.mm:
813 (ObjcClass::methodsNamed):
814 * bindings/runtime.h:
815 * bindings/runtime_object.cpp:
816 (RuntimeObjectImp::get):
817 (RuntimeObjectImp::hasProperty):
819 2004-09-29 Chris Blumenberg <cblu@apple.com>
821 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.
825 * JavaScriptCore.pbproj/project.pbxproj:
826 * bindings/NP_jsobject.cpp:
827 (_NPN_CreateScriptObject):
828 (_NPN_InvokeDefault):
833 (_NPN_RemoveProperty):
836 * bindings/c/c_class.cpp:
837 (CClass::methodsNamed):
838 (CClass::fieldNamed):
839 * bindings/c/c_instance.cpp:
840 (CInstance::CInstance):
841 (CInstance::~CInstance):
842 (CInstance::operator=):
843 (CInstance::invokeMethod):
844 (CInstance::invokeDefaultMethod):
845 * bindings/c/c_runtime.cpp:
846 * bindings/c/c_runtime.h:
847 (KJS::Bindings::CField::name):
848 (KJS::Bindings::CMethod::name):
849 * bindings/npruntime.cpp:
850 (_NPN_GetStringIdentifier):
851 (_NPN_GetStringIdentifiers):
852 (_NPN_GetIntIdentifier):
853 (_NPN_IdentifierIsString):
854 (_NPN_UTF8FromIdentifier):
855 (_NPN_IntFromIdentifier):
856 (NPN_InitializeVariantWithObject):
857 (_NPN_ReleaseVariantValue):
860 (_NPN_ReleaseObject):
861 (_NPN_SetExceptionWithUTF8):
864 2004-09-26 Darin Adler <darin@apple.com>
866 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
867 low() to get Unicode value of character, and just use unicode().
869 2004-09-26 Darin Adler <darin@apple.com>
871 - refine charAt/charCodeAt fix slightly
873 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
874 omitted parameter, as we do everywhere else, and as other browsers do here.
876 2004-09-26 Darin Adler <darin@apple.com>
880 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
882 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
883 the program. We were doing this properly for functions, but not entire programs.
885 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
887 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
888 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
890 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
896 2004-09-14 Richard Williamson <rjw@apple.com>
898 1. Add class parameter to object allocation function. This is somewhat redundant, given that
899 the allocation function is in the class function vector, but people wanted to use the same
900 allocation function for different classes.
902 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
904 3. Add support for a default function on an object. This is a feature that ActiveX supports,
905 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
906 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
907 'Objective-C' bindings.
909 There bugs are covered by
911 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
912 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
913 <rdar://problem/3674754> Need to implement latest npruntime.h
917 * bindings/NP_jsobject.cpp:
921 * bindings/c/c_class.cpp:
922 * bindings/c/c_instance.cpp:
923 (CInstance::CInstance):
924 (CInstance::operator=):
925 (CInstance::invokeMethod):
926 (CInstance::invokeDefaultMethod):
927 * bindings/c/c_instance.h:
928 * bindings/c/c_runtime.cpp:
929 * bindings/c/c_runtime.h:
930 * bindings/jni/jni_instance.cpp:
931 (JavaInstance::invokeDefaultMethod):
932 * bindings/jni/jni_instance.h:
933 * bindings/npruntime.cpp:
935 * bindings/npruntime.h:
936 * bindings/objc/WebScriptObject.h:
937 * bindings/objc/objc_class.mm:
938 (ObjcClass::fallbackObject):
939 * bindings/objc/objc_instance.h:
940 * bindings/objc/objc_instance.mm:
941 (ObjcInstance::invokeDefaultMethod):
942 * bindings/objc/objc_runtime.h:
943 * bindings/objc/objc_runtime.mm:
944 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
945 (ObjcFallbackObjectImp::get):
946 (ObjcFallbackObjectImp::put):
947 (ObjcFallbackObjectImp::canPut):
948 (ObjcFallbackObjectImp::implementsCall):
949 (ObjcFallbackObjectImp::call):
950 (ObjcFallbackObjectImp::hasProperty):
951 (ObjcFallbackObjectImp::deleteProperty):
952 (ObjcFallbackObjectImp::defaultValue):
953 * bindings/runtime.h:
954 (KJS::Bindings::Class::fallbackObject):
955 (KJS::Bindings::Instance::getValueOfUndefinedField):
956 (KJS::Bindings::Instance::setValueOfUndefinedField):
957 (KJS::Bindings::Instance::valueOf):
958 * bindings/runtime_object.cpp:
959 (RuntimeObjectImp::implementsCall):
960 (RuntimeObjectImp::call):
961 * bindings/runtime_object.h:
963 2004-09-13 Maciej Stachowiak <mjs@apple.com>
967 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
969 * kjs/string_object.cpp:
970 (StringProtoFuncImp::call): Replaced implementation of replace()
971 method with function below...
972 (replace): In order to avoid excessive allocation and copying,
973 figure out the ranges of the original string and replacement
974 strings to be assembled, instead of constantly creating new
975 strings at each substitution. The old behavior is basically O(N^2)
976 for a global replace on a pattern that matches many places in the
978 (regExpIsGlobal): Helper function for the above.
979 (expandSourceRanges): ditto
980 (pushSourceRange): ditto
981 (expandReplacements): ditto
982 (pushReplacement): ditto
984 (KJS::UString::spliceSubstringsWithSeparators): New method that
985 pieces together substring ranges of this string together with
986 specified separators, all at one go.
988 (KJS::UString::Range::Range): Added new helper class to represent
991 2004-09-14 Maciej Stachowiak <mjs@apple.com>
995 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
998 (KJS::GlobalFuncImp::call): Make sure to escape null
999 characters. This is a bug in the new code that made part of the
1002 2004-09-13 Darin Adler <darin@apple.com>
1004 Reviewed by Kevin and Maciej.
1006 - new function to support fix for DIG bug in WebCore
1008 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1009 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1011 2004-09-12 Darin Adler <darin@apple.com>
1013 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1014 of escape and unescape.
1016 2004-09-12 Darin Adler <darin@apple.com>
1020 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1022 * kjs/date_object.cpp:
1023 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1024 uses CFDateFormatter.
1025 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1027 2004-09-09 Maciej Stachowiak <mjs@apple.com>
1029 Reviewed by Richard.
1031 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1034 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1035 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1037 (Lexer::isHexDigit): Made static and non-const.
1042 2004-09-06 Darin Adler <darin@apple.com>
1044 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1048 2004-09-01 Richard Williamson <rjw@apple.com>
1050 Add pid to exception messages (to help debug dashboard clients).
1054 * kjs/interpreter.cpp:
1055 (Interpreter::evaluate):
1059 2004-08-20 Richard Williamson <rjw@apple.com>
1061 Implemented new JNI abstraction. We no longer invoke Java methods
1062 directly with JNI, rather we call into the plugin. This allows the
1063 plugin to dispatch the call to the appropriate VM thread. This
1064 change should (will?) fix a whole class of threading related problems with
1069 * JavaScriptCore.pbproj/project.pbxproj:
1070 * bindings/c/c_instance.h:
1071 (KJS::Bindings::CInstance::setExecutionContext):
1072 (KJS::Bindings::CInstance::executionContext):
1073 * bindings/jni/jni_instance.cpp:
1074 (JavaInstance::JavaInstance):
1075 (JavaInstance::invokeMethod):
1076 (JavaInstance::setExecutionContext):
1077 (JavaInstance::executionContext):
1078 * bindings/jni/jni_instance.h:
1079 * bindings/jni/jni_jsobject.cpp:
1080 (JSObject::convertJObjectToValue):
1081 * bindings/jni/jni_runtime.cpp:
1082 (JavaField::JavaField):
1083 (JavaArray::convertJObjectToArray):
1084 (JavaField::valueFromInstance):
1085 (JavaArray::JavaArray):
1086 (JavaArray::valueAt):
1087 * bindings/jni/jni_runtime.h:
1088 (KJS::Bindings::JavaArray::operator=):
1089 (KJS::Bindings::JavaArray::executionContext):
1090 * bindings/jni/jni_utility.h:
1091 * bindings/objc/objc_instance.h:
1092 (KJS::Bindings::ObjcInstance::setExecutionContext):
1093 (KJS::Bindings::ObjcInstance::executionContext):
1094 * bindings/runtime.cpp:
1095 (Instance::createBindingForLanguageInstance):
1096 * bindings/runtime.h:
1097 * bindings/runtime_root.h:
1098 (KJS::Bindings::RootObject::nativeHandle):
1102 2004-08-19 Vicki Murley <vicki@apple.com>
1106 * kjs/property_map.cpp:
1107 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1109 2004-08-17 Darin Adler <darin@apple.com>
1113 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1115 * kjs/property_map.h: Added some private functions.
1116 * kjs/property_map.cpp:
1117 (KJS::PropertyMap::clear): Set sentinelCount to 0.
1118 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1119 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1120 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1121 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1122 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1123 deleted-element sentinels.
1124 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1126 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1128 Code change by Eric Albert, reviewd by me.
1130 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1132 * kjs/date_object.cpp:
1133 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1134 entirely would be even better, but is not required to fix this bug.
1138 2004-08-16 Richard Williamson <rjw@apple.com>
1140 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1142 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1146 * bindings/NP_jsobject.cpp:
1148 * bindings/jni/jni_jsobject.cpp:
1150 * bindings/objc/WebScriptObject.mm:
1151 (-[WebScriptObject evaluateWebScript:]):
1153 2004-08-15 Richard Williamson <rjw@apple.com>
1155 More updates to np headers. Implemented new NPN functions.
1159 * bindings/NP_jsobject.cpp:
1163 * bindings/npruntime.h:
1165 2004-08-13 Darin Adler <darin@apple.com>
1167 - fix build so we can compile again
1169 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1170 is good enough so that we can compile, but it's only a stopgap measure, because I think
1171 Richard has a newer one he wants to check in.
1173 2004-08-12 Richard Williamson <rjw@apple.com>
1175 Bring npruntime.h and friends closer to compliance with
1180 * JavaScriptCore.pbproj/project.pbxproj:
1181 * bindings/NP_jsobject.cpp:
1183 (_NPN_CreateScriptObject):
1188 (NPN_RemoveProperty):
1189 * bindings/NP_jsobject.h:
1190 * bindings/c/c_instance.cpp:
1191 (CInstance::invokeMethod):
1192 * bindings/c/c_utility.cpp:
1193 (convertNPVariantToValue):
1194 * bindings/npruntime.cpp:
1195 (NPN_IdentifierIsString):
1196 (NPN_VariantIsVoid):
1197 (NPN_VariantIsNull):
1198 (NPN_VariantIsUndefined):
1199 (NPN_VariantIsBool):
1200 (NPN_VariantIsInt32):
1201 (NPN_VariantIsDouble):
1202 (NPN_VariantIsString):
1203 (NPN_VariantIsObject):
1204 (NPN_VariantToBool):
1205 (NPN_VariantToString):
1206 (NPN_VariantToInt32):
1207 (NPN_VariantToDouble):
1208 (NPN_VariantToObject):
1209 (NPN_InitializeVariantAsVoid):
1210 (NPN_InitializeVariantAsNull):
1211 (NPN_InitializeVariantAsUndefined):
1212 (NPN_InitializeVariantWithBool):
1213 (NPN_InitializeVariantWithInt32):
1214 (NPN_InitializeVariantWithDouble):
1215 (NPN_InitializeVariantWithString):
1216 (NPN_InitializeVariantWithStringCopy):
1217 (NPN_InitializeVariantWithObject):
1218 (NPN_InitializeVariantWithVariant):
1219 (NPN_ReleaseVariantValue):
1221 * bindings/npruntime.h:
1223 (_NPString::_NPVariant::):
1224 * bindings/npruntime_priv.h: Added.
1226 2004-08-12 Darin Adler <darin@apple.com>
1230 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1233 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1234 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1235 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1236 to skip leading "+" or "-".
1240 2004-08-12 Darin Adler <darin@apple.com>
1244 - fixed 43 Mozilla JavaScript tests
1246 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1247 * kjs/date_object.cpp:
1248 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1249 than constructing a number object to pass to it.
1250 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1251 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1252 (KJS::timeClip): Implement this as specified in the language standard.
1254 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1255 flags on the prototype property.
1258 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1260 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1262 (KJS::parseDigit): Added. Helper function for parseInt.
1263 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1264 strtoll can handle. Also matches standard more closely.
1265 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1267 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1269 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1271 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1273 (Lexer::setCode): Clear error state.
1274 (Lexer::lex): Set error state if the lexer encounters an error
1277 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1278 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1280 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1281 Change round to round values between -0.5 and -0 to -0 instead of +0.
1283 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1284 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1285 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1286 would change x.y into a value that can't be deleted as a side effect.
1288 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1291 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1292 get rid of the fixed size limit for code.
1294 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1295 returns the string without creating a new Rep, since I'm using substr in a place where it will
1296 often be passed a 0.
1298 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1299 the other day that was making a couple tests fail.
1300 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1301 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1302 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1303 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1304 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1306 * kjs/string_object.lut.h: Regenerated.
1308 2004-08-11 Darin Adler <darin@apple.com>
1310 - fixed a tiny problem with the UTF-16 PCRE check-in
1312 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1313 the ctype_meta flag to get set in items that should not have it.
1315 * pcre/chartables.c: Regenerated.
1317 2004-08-10 Richard Williamson <rjw@apple.com>
1319 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1321 The following WebScripting methods are now supported on bound
1324 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1325 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1326 - (id)valueForUndefinedKey:(NSString *)key
1330 * bindings/c/c_class.cpp:
1331 (CClass::fieldNamed):
1332 * bindings/c/c_class.h:
1333 * bindings/jni/jni_class.cpp:
1334 (JavaClass::fieldNamed):
1335 * bindings/jni/jni_class.h:
1336 * bindings/objc/objc_class.h:
1337 (KJS::Bindings::ObjcClass::isa):
1338 * bindings/objc/objc_class.mm:
1339 (ObjcClass::methodsNamed):
1340 (ObjcClass::fieldNamed):
1341 (ObjcClass::fallbackObject):
1342 * bindings/objc/objc_instance.h:
1343 * bindings/objc/objc_instance.mm:
1344 (ObjcInstance::invokeMethod):
1345 (ObjcInstance::setValueOfField):
1346 (ObjcInstance::setValueOfUndefinedField):
1347 (ObjcInstance::getValueOfField):
1348 (ObjcInstance::getValueOfUndefinedField):
1349 * bindings/objc/objc_runtime.h:
1350 (KJS::Bindings::ObjcField::~ObjcField):
1351 (KJS::Bindings::ObjcField::ObjcField):
1352 (KJS::Bindings::ObjcField::operator=):
1353 (KJS::Bindings::FallbackObjectImp::classInfo):
1354 * bindings/objc/objc_runtime.mm:
1355 (ObjcField::ObjcField):
1358 (ObjcField::valueFromInstance):
1359 (ObjcField::setValueToInstance):
1360 (FallbackObjectImp::FallbackObjectImp):
1361 (FallbackObjectImp::get):
1362 (FallbackObjectImp::put):
1363 (FallbackObjectImp::canPut):
1364 (FallbackObjectImp::implementsCall):
1365 (FallbackObjectImp::call):
1366 (FallbackObjectImp::hasProperty):
1367 (FallbackObjectImp::deleteProperty):
1368 (FallbackObjectImp::defaultValue):
1369 * bindings/runtime.h:
1370 (KJS::Bindings::Class::fallbackObject):
1371 (KJS::Bindings::Instance::getValueOfUndefinedField):
1372 (KJS::Bindings::Instance::setValueOfUndefinedField):
1373 * bindings/runtime_object.cpp:
1374 (RuntimeObjectImp::get):
1375 (RuntimeObjectImp::put):
1376 (RuntimeObjectImp::canPut):
1377 (RuntimeObjectImp::hasProperty):
1378 * bindings/testbindings.mm:
1379 (-[MyFirstInterface valueForUndefinedKey:]):
1380 (-[MyFirstInterface setValue:forUndefinedKey:]):
1382 2004-08-10 Darin Adler <darin@apple.com>
1386 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1388 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1389 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1390 that need to use it.
1391 * pcre/pcre.c: Add UTF-16 support to all functions.
1392 * pcre/study.c: Ditto.
1394 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1395 the mode. Changed declarations to use symbolic constants and typedefs so we size
1396 things to ichar when needed.
1398 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1399 sized to 16-bit characters instead of 8-bit.
1402 (pcre_copy_substring): Use pcre_char instead of char.
1403 (pcre_get_substring_list): Ditto.
1404 (pcre_free_substring_list): Ditto.
1405 (pcre_get_substring): Ditto.
1406 (pcre_free_substring): Ditto.
1408 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1409 of hard-coding 8-bit table sizes.
1411 * pcre/chartables.c: Regenerated.
1413 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1414 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1415 is not null. The null string still has a null pointer. This prevents us from
1416 passing a null through to the regular expression engine (which results in a null
1417 error even when the string length is 0).
1420 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1421 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1423 2004-08-09 Darin Adler <darin@apple.com>
1427 - fixed 28 Mozilla JavaScript tests
1429 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1430 checking the number of arguments for the join method.
1432 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1433 than integers, so we aren't limited to 32 bits.
1435 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1436 the implementation of the pow operation. Also simplied a case that was handling positive
1437 and negative infinity separately.
1439 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1440 putting them in a long, so that unsigned shift will work properly.
1442 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1444 * kjs/operations.cpp:
1445 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1446 sign of isinf; our isinf function returns +1 even for negative infinity.
1447 (KJS::isNegInf): And again.
1448 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1449 Our floating point already handles the various infinity cases correctly.
1451 * kjs/regexp_object.cpp:
1452 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1453 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1454 array in cases where we did not match.
1455 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1456 "global", "ignoreCase", "multiline", and "source".
1458 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1459 string into undefined rather than an empty string. For the slice method, handle an
1460 undefined parameter for the limit properly as decribed in the specification, and add
1461 the limit to one case that didn't have the limit at all. For the methods that generate
1462 HTML strings, use lowercase tags instead of uppercase.
1465 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1466 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1467 (KJS::UString::append): Fix some math that caused a buffer overflow.
1468 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1469 flag) rather than converting them all to 0.
1470 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1472 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1474 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1475 the Unicode specification in a few cases where it was wrong before.
1476 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1477 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1478 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1479 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1480 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1481 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1482 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1483 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1484 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1486 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1488 * kjs/number_object.lut.h: Regenerated.
1490 2004-08-09 Darin Adler <darin@apple.com>
1494 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1496 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1497 we get a buffer overflow.
1501 2004-08-05 Richard Williamson <rjw@apple.com>
1503 Fixed part of 3674747. The QT guys need this for feature freeze.
1505 This patch implements support for the
1507 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1509 method of objects bound to JavaScript.
1514 * bindings/objc/objc_class.mm:
1515 (ObjcClass::methodsNamed):
1516 (ObjcClass::fieldNamed):
1517 * bindings/objc/objc_instance.mm:
1518 (ObjcInstance::invokeMethod):
1519 * bindings/objc/objc_runtime.h:
1520 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1521 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1522 (KJS::Bindings::ObjcMethod::javaScriptName):
1523 * bindings/objc/objc_runtime.mm:
1524 (ObjcMethod::ObjcMethod):
1525 (ObjcMethod::getMethodSignature):
1526 (ObjcMethod::setJavaScriptName):
1527 * bindings/testbindings.mm:
1529 2004-08-04 Vicki Murley <vicki@apple.com>
1533 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1536 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1537 go to the next line and continue parsing the string (instead of failing). This matches
1538 behavior in Mac IE and Mozilla.
1540 2004-08-03 Kevin Decker <kdecker@apple.com>
1544 Rolled in changes from the latest KJS sources that support additional
1545 Number.prototype functions.
1547 Specifically this patch covers the follow parts of the ECMA 3 spec:
1548 15.7.4.5, 15.7.4.6, and 15.7.4.7
1551 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1552 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1553 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1555 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1556 list of supported identifiers (a macro).
1557 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1558 and toExponential().
1559 (NumberPrototypeImp::NumberPrototypeImp):
1560 (NumberProtoFuncImp::call):
1561 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1563 (KJS::NumberProtoFuncImp::):
1564 * tests/mozilla/expected.html: Update results.
1566 2004-08-03 Darin Adler <darin@apple.com>
1570 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1572 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1573 we are supposed to just copy the regular expression object, and do so.
1574 Also tighten up arguments check to handle case where an actual "undefined"
1575 is passed rather than just omitting an argument.
1577 * tests/mozilla/expected.html: Update results.
1579 2004-08-02 Darin Adler <darin@apple.com>
1581 * tests/mozilla/.cvsignore: Added.
1582 * tests/mozilla/expected.html: Update results.
1584 2004-08-02 Darin Adler <darin@apple.com>
1588 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1590 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1591 Append the flags here so more tests paseed.
1593 2004-08-02 Darin Adler <darin@apple.com>
1597 - fixed a couple things making 5 Mozilla regexp tests pass
1599 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1601 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1602 be used as the flags string when no parameter was passed.
1604 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1605 Added a class info object for RegExp prototype so it can return
1606 a string instead of raising an exception when converting to a string.
1608 * tests/mozilla/expected.html: Update results.
1610 2004-08-02 Darin Adler <darin@apple.com>
1614 - fix crashes in mozilla tests due to mishandling NaN
1616 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1617 calls to toInteger so that NaN will get turned into something that fits in an integer.
1618 These were the ones John already fixed, but his fix used isnan and the new fix is
1621 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1622 after a call to toInteger to handle NaN properly. Also removed separate check
1623 for undefined that's not needed.
1625 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1626 as in the above two files, but for a lot more functions. Also changed one place with
1627 an explicit check for undefined to instead just check isNaN.
1629 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1630 like me who don't keep $SYMROOTS in their $PATH.
1636 2004-07-26 Kevin Decker <kdecker@apple.com>
1638 Changes done by Darin, reviewed by Kevin.
1640 - changed testkjs to build in Xcode rather than from Makefile
1642 * .cvsignore: Removed obsolete files from this list.
1643 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1644 Changed to build target "All" rather than default target. This makes us
1645 build the testkjs test tool.
1646 * dummy.cpp: Removed.
1647 * kjs/.cvsignore: Removed obsolete files from this list, including
1648 the testkjs tool, which is now built in the symroots directory.
1649 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1650 changed this file. Also this has the nice side effect of causing the tool
1651 to be rebuilt in the new location even if there are no other changes in
1652 your tree when you check this out.
1653 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1654 without setting the execute bit on jsDriver.pl.
1656 2004-07-22 Kevin Decker <kdecker@apple.com>
1660 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1662 * kjs/function_object.cpp:
1663 (FunctionObjectImp::construct):
1664 * kjs/function_object.h:
1666 (KJS::ObjectImp::construct):
1668 (KJS::Object::construct):
1670 2004-07-21 Darin Adler <darin@apple.com>
1672 * bindings/npruntime.h: Fixed typo.
1674 2004-07-19 John Sullivan <sullivan@apple.com>
1678 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1679 vulnerability in my patch for 3714644
1681 * kjs/array_object.cpp:
1682 (ArrayProtoFuncImp::call):
1683 handle NAN parameters passed to slice() by clamping to 0 and length.
1685 2004-07-19 Richard Williamson <rjw@apple.com>
1687 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1692 * bindings/jni/jni_jsobject.cpp:
1694 (JSObject::JSObject):
1696 2004-07-16 John Sullivan <sullivan@apple.com>
1700 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1701 hangs browser with javascript
1703 * kjs/array_object.cpp:
1704 (ArrayProtoFuncImp::call):
1705 Check for undefined type for args[0] the same way we were already checking
1706 for args[1]. In this case, args was zero-length, but we were treating
1707 args[0] like an integer anyway. Resulted in some code looping from a NAN
1708 value to 4, taking approximately forever.
1710 * JavaScriptCore.pbproj/project.pbxproj:
1715 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1719 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1720 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1722 * kjs/number_object.cpp:
1723 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1725 2004-07-13 Kevin Decker <kdecker@apple.com>
1727 Reviewed by kocienda.
1729 - made testkjs and JavaScriptCore a subtarget of 'All'
1730 - testkjs now builds in $SYMROOTS
1732 * JavaScriptCore.pbproj/project.pbxproj:
1736 2004-06-24 Chris Blumenberg <cblu@apple.com>
1738 Ignore .mode1 files in JavaScriptCore.pbproj
1740 Reviewed by kocienda.
1742 * JavaScriptCore.pbproj/.cvsignore:
1744 2004-06-23 Richard Williamson <rjw@apple.com>
1746 Implemented changes for latest npruntime.h.
1750 * JavaScriptCore.pbproj/project.pbxproj:
1751 * bindings/NP_jsobject.cpp:
1752 (listFromVariantArgs):
1753 (identiferFromNPIdentifier):
1754 (_NPN_CreateScriptObject):
1759 (NPN_RemoveProperty):
1760 * bindings/NP_jsobject.h:
1761 * bindings/c/c_class.cpp:
1762 (CClass::methodsNamed):
1763 (CClass::fieldNamed):
1764 * bindings/c/c_instance.cpp:
1765 (CInstance::invokeMethod):
1766 * bindings/c/c_utility.cpp:
1767 (convertNPVariantToValue):
1768 * bindings/c/c_utility.h:
1769 * bindings/npruntime.cpp:
1770 (stringIdentifierEqual):
1771 (stringIdentifierHash):
1772 (getStringIdentifierDictionary):
1773 (intIdentifierEqual):
1774 (intIdentifierHash):
1775 (getIntIdentifierDictionary):
1776 (NPN_GetStringIdentifier):
1777 (NPN_GetStringIdentifiers):
1778 (NPN_GetIntIdentifier):
1779 (NPN_IdentifierIsString):
1780 (NPN_UTF8FromIdentifier):
1781 (NPN_VariantToInt32):
1782 (NPN_VariantToDouble):
1784 * bindings/npruntime.h:
1785 * bindings/objc/WebScriptObject.mm:
1786 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1787 * bindings/runtime_object.cpp:
1788 (RuntimeObjectImp::~RuntimeObjectImp):
1789 * bindings/runtime_root.cpp:
1790 (KJS::Bindings::rootForInterpreter):
1791 * bindings/testbindings.cpp:
1792 (initializeIdentifiers):
1798 === JavaScriptCore-146.1 ===
1800 2004-06-16 Richard Williamson <rjw@apple.com>
1802 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1804 This turned out to be a show stopper for Dashboard. Accessing a nil
1805 ObjC property from JS caused a crash. Similar to the problem
1806 3696112 fixed below.
1810 * bindings/objc/objc_runtime.mm:
1811 (KJS::Bindings::ObjcField::valueFromInstance):
1815 2004-06-16 Richard Williamson <rjw@apple.com>
1817 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1819 This turned out to be a show stopper for Dashboard. We now
1820 return Undefined() when nil is returned from a ObjC method
1821 that returns an object type.
1825 * bindings/objc/objc_utility.mm:
1826 (KJS::Bindings::convertObjcValueToValue):
1830 2004-06-15 Richard Williamson <rjw@apple.com>
1832 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1834 No longer need to check respondsToSelector: for
1835 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1836 because these now have a default implementation on NSObject.
1840 * bindings/objc/objc_class.mm:
1841 (ObjcClass::methodsNamed):
1842 (ObjcClass::fieldNamed):
1844 2004-06-14 Darin Adler <darin@apple.com>
1848 - fixed some things for GC that Patrick missed, or that happened after the branch
1850 * bindings/objc/WebScriptObject.mm:
1851 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1852 (-[WebScriptObject finalize]): Added.
1854 - added some missing nil checks
1856 * bindings/objc/objc_instance.mm:
1857 (ObjcInstance::ObjcInstance): Check for nil.
1858 (ObjcInstance::~ObjcInstance): Check for nil.
1859 (ObjcInstance::operator=): Check for nil.
1861 2004-06-14 Darin Adler <darin@apple.com>
1863 Reviewed by me, code changes by Patrick Beard.
1865 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1867 * bindings/objc/objc_instance.mm:
1868 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1869 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1870 (ObjcInstance::operator=): More of the same.
1871 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1873 * bindings/objc/objc_runtime.mm:
1874 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1875 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1876 (ObjcArray::operator=): More of the same.
1878 * bindings/testbindings.mm: Fixed incorrect license.
1879 (main): Use [pool drain] if compiling on Tiger.
1883 2004-06-10 Kevin Decker <kdecker@apple.com>
1889 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1891 (KJS::Lexer::lineNo):
1892 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1894 === JavaScriptCore-143.2 ===
1896 2004-06-07 Darin Adler <darin@apple.com>
1898 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1900 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1901 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1903 === JavaScriptCore-143.1 ===
1905 2004-06-04 Kevin Decker <kdecker@apple.com>
1909 - fixed <rdar://problem/3680594>
1912 (KJS::Error::create):
1916 2004-06-04 Darin Adler <darin@apple.com>
1918 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1920 2004-06-04 Kevin Decker <kdecker@apple.com>
1924 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1925 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1926 - changed the wording of an error message
1927 - the lexer, parser, and interpreter have been made "sourceURL aware"
1928 - stored the url into Error
1930 * bindings/NP_jsobject.cpp:
1932 * bindings/jni/jni_jsobject.cpp:
1934 * bindings/objc/WebScriptObject.mm:
1935 (-[WebScriptObject evaluateWebScript:]):
1937 (GlobalFuncImp::call):
1938 * kjs/function_object.cpp:
1939 (FunctionObjectImp::construct):
1942 (InterpreterImp::checkSyntax):
1943 (InterpreterImp::evaluate):
1945 * kjs/interpreter.cpp:
1946 (Interpreter::evaluate):
1947 * kjs/interpreter.h:
1951 (KJS::Lexer::sourceURL):
1955 (FunctionCallNode::evaluate):
1958 (KJS::Error::create):
1961 2004-06-04 Richard Williamson <rjw@apple.com>
1963 Fixed crash when attempting to access properties on nil
1968 * bindings/objc/objc_instance.mm:
1969 (ObjcInstance::getClass):
1970 * bindings/runtime_object.cpp:
1971 (RuntimeObjectImp::get):
1972 * bindings/testM.js:
1973 * bindings/testbindings.mm:
1974 (-[MyFirstInterface getString]):
1976 2004-05-27 Kevin Decker <kdecker@apple.com>
1980 -revised generated error message content
1982 * kjs/error_object.cpp:
1983 (ErrorProtoFuncImp::call):
1987 (KJS::Error::create):
1991 2004-05-27 Richard Williamson <rjw@apple.com>
1993 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
1997 * bindings/objc/WebScriptObject.h:
1999 2004-05-27 Darin Adler <darin@apple.com>
2003 - moved to new symlink technique for embedding frameworks
2005 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2006 because we don't need it any more.
2008 2004-05-24 Richard Williamson <rjw@apple.com>
2010 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2011 fixed ClassInfo to correctly reflect inheritance. This is required
2012 because of the runtime checks in JSC for arrays, i.e. in
2013 the Function objects apply method.
2017 * bindings/jni/jni_runtime.cpp:
2018 (JavaArray::convertJObjectToArray):
2019 * bindings/objc/objc_utility.mm:
2020 (KJS::Bindings::convertObjcValueToValue):
2021 * bindings/runtime_array.cpp:
2022 (RuntimeArrayImp::RuntimeArrayImp):
2023 * bindings/runtime_array.h:
2024 * bindings/testM.js: Added.
2025 * bindings/testbindings.mm:
2026 (+[MyFirstInterface webScriptNameForSelector:]):
2027 (-[MyFirstInterface logMessages:]):
2028 (-[MyFirstInterface logMessage:prefix:]):
2029 (-[MyFirstInterface callJSObject::]):
2031 2004-05-22 Darin Adler <darin@apple.com>
2035 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2037 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2038 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2039 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2040 it hasn't been set explicitly.
2044 2004-05-20 Richard Williamson <rjw@apple.com>
2046 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
2047 can now be referenced like any other WebScriptObject, meaning
2048 you can do JS operations on them.
2050 All added implementation of finalizeForWebScript.
2054 * bindings/objc/WebScriptObject.h:
2055 * bindings/objc/WebScriptObject.mm:
2056 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2057 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2058 (-[WebScriptObject KJS::]):
2059 (-[WebScriptObject dealloc]):
2060 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2061 (-[WebScriptObject evaluateWebScript:]):
2062 (-[WebScriptObject setValue:forKey:]):
2063 (-[WebScriptObject valueForKey:]):
2064 (-[WebScriptObject stringRepresentation]):
2065 * bindings/objc/WebScriptObjectPrivate.h:
2066 * bindings/objc/objc_instance.mm:
2067 (ObjcInstance::~ObjcInstance):
2069 2004-05-19 Richard Williamson <rjw@apple.com>
2071 Removed extraneous tabs that were added (by XCode?).
2073 * bindings/objc/WebScriptObject.h:
2075 2004-05-19 Darin Adler <darin@apple.com>
2077 - fixed headers with licenses mangled by Xcode auto-indenting
2079 * bindings/jni/jni_jsobject.cpp:
2080 * bindings/jni/jni_jsobject.h:
2081 * bindings/runtime_array.h:
2082 * bindings/runtime_root.cpp:
2083 * bindings/runtime_root.h:
2085 2004-05-18 Richard Williamson <rjw@apple.com>
2087 Added exception logging. Also check for exception and
2088 set results as appropriate.
2090 Reviewed by Maciej (partially reviewed).
2092 * bindings/objc/WebScriptObject.mm:
2093 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2094 (-[WebScriptObject evaluateWebScript:]):
2095 (-[WebScriptObject setValue:forKey:]):
2096 (-[WebScriptObject valueForKey:]):
2098 2004-05-18 Richard Williamson <rjw@apple.com>
2100 Finsished implementing support for windowScriptObject.
2101 Had to make WebScriptObjectPrivate.h accessible from
2106 * JavaScriptCore.pbproj/project.pbxproj:
2107 * bindings/objc/WebScriptObjectPrivate.h:
2109 2004-05-18 Richard Williamson <rjw@apple.com>
2111 Use KVC to set/get values instead of directly accessing
2116 * bindings/objc/WebScriptObject.mm:
2117 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2118 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2119 * bindings/objc/objc_runtime.mm:
2120 (ObjcField::valueFromInstance):
2121 (convertValueToObjcObject):
2122 (ObjcField::setValueToInstance):
2124 2004-05-17 Richard Williamson <rjw@apple.com>
2126 Implemented new API for WebScriptObject.
2128 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2129 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
2133 * JavaScriptCore.pbproj/project.pbxproj:
2134 * bindings/c/c_instance.cpp:
2135 (CInstance::invokeMethod):
2136 * bindings/jni/jni_instance.cpp:
2137 (JavaInstance::invokeMethod):
2138 * bindings/jni/jni_jsobject.cpp:
2139 (JSObject::convertValueToJObject):
2140 * bindings/jni/jni_utility.cpp:
2141 (KJS::Bindings::getJNIField):
2142 * bindings/objc/WebScriptObject.mm:
2144 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2145 (-[WebScriptObject KJS::]):
2146 (-[WebScriptObject dealloc]):
2147 (+[WebScriptObject throwException:]):
2149 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2150 (-[WebScriptObject evaluateWebScript:]):
2151 (-[WebScriptObject setValue:forKey:]):
2152 (-[WebScriptObject valueForKey:]):
2153 (-[WebScriptObject stringRepresentation]):
2154 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2155 (+[WebUndefined undefined]):
2156 (-[WebUndefined initWithCoder:]):
2157 (-[WebUndefined encodeWithCoder:]):
2158 (-[WebUndefined copyWithZone:]):
2159 (-[WebUndefined retain]):
2160 (-[WebUndefined release]):
2161 (-[WebUndefined retainCount]):
2162 (-[WebUndefined autorelease]):
2163 (-[WebUndefined dealloc]):
2164 (-[WebUndefined copy]):
2165 (-[WebUndefined replacementObjectForPortCoder:]):
2166 * bindings/objc/WebScriptObjectPrivate.h: Added.
2167 * bindings/objc/objc_class.mm:
2168 (ObjcClass::methodsNamed):
2169 (ObjcClass::fieldNamed):
2170 * bindings/objc/objc_instance.mm:
2171 (ObjcInstance::invokeMethod):
2172 * bindings/objc/objc_jsobject.h:
2173 * bindings/objc/objc_jsobject.mm:
2174 * bindings/objc/objc_runtime.mm:
2175 (ObjcField::valueFromInstance):
2176 * bindings/objc/objc_utility.mm:
2177 (KJS::Bindings::JSMethodNameToObjCMethodName):
2178 (KJS::Bindings::convertValueToObjcValue):
2179 (KJS::Bindings::convertObjcValueToValue):
2180 * bindings/runtime.cpp:
2181 (Instance::setDidExecuteFunction):
2182 (Instance::didExecuteFunction):
2183 (Instance::setValueOfField):
2184 * bindings/runtime.h:
2185 * bindings/testbindings.mm:
2186 (+[MyFirstInterface webScriptNameForSelector:]):
2187 (-[MyFirstInterface callJSObject::]):
2189 2004-05-14 Vicki Murley <vicki@apple.com>
2193 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2195 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2199 2004-05-13 Richard Williamson <rjw@apple.com>
2206 * bindings/objc/WebScriptObject.h:
2208 2004-05-13 Richard Williamson <rjw@apple.com>
2210 Approved API changes. Currently unimplemented.
2215 * JavaScriptCore.pbproj/project.pbxproj:
2216 * bindings/objc/WebScriptObject.h: Added.
2217 * bindings/objc/WebScriptObject.mm: Added.
2218 (+[WebScriptObject throwException:]):
2219 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2220 (-[WebScriptObject evaluateWebScript:]):
2221 (-[WebScriptObject stringRepresentation]):
2222 (+[WebUndefined undefined]):
2223 (-[WebUndefined initWithCoder:]):
2224 (-[WebUndefined encodeWithCoder:]):
2225 (-[WebUndefined copyWithZone:]):
2227 2004-05-07 Vicki Murley <vicki@apple.com>
2231 Turn off GC since it uses ppc only instructions (which breaks
2234 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2238 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2242 - add -funroll-loops=16 compiler option for approx .5% speedup on
2243 HTML iBench and .5-1% speedup on JS iBench.
2245 * JavaScriptCore.pbproj/project.pbxproj:
2247 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2251 Enable full conservative GC mode in addition to test mode. When
2252 conservative GC is enabled, we now get an 11% speed improvement on
2253 the iBench. Also fix some spots I missed before.
2255 Specific noteworth changes:
2257 * kjs/collector.cpp:
2258 (KJS::Collector::markStackObjectsConservatively): Check possible
2259 cell pointers for 8-byte aligment and verify they are not 0.
2261 * kjs/protected_values.cpp:
2262 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2263 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2265 (KJS::gcProtectNullTolerant): ...to here...
2266 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2267 tolerance, and doing the check is expensive.
2269 * kjs/protected_values.cpp:
2270 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2271 that is still very good.
2276 (KJS::ProtectedValue::ProtectedValue):
2277 (KJS::ProtectedValue::~ProtectedValue):
2278 (KJS::ProtectedValue::operator=):
2279 (KJS::ProtectedObject::ProtectedObject):
2280 (KJS::ProtectedObject::~ProtectedObject):
2281 (KJS::ProtectedObject::operator=):
2282 (KJS::ProtectedReference::ProtectedReference):
2283 (KJS::ProtectedReference::~ProtectedReference):
2284 (KJS::ProtectedReference::operator=):
2285 * kjs/protected_values.cpp:
2286 (KJS::ProtectedValues::getProtectCount):
2287 (KJS::ProtectedValues::increaseProtectCount):
2288 (KJS::ProtectedValues::decreaseProtectCount):
2289 (KJS::ProtectedValues::computeHash):
2290 * bindings/runtime_root.cpp:
2291 (KJS::Bindings::addNativeReference):
2292 (KJS::Bindings::removeNativeReference):
2293 (RootObject::removeAllNativeReferences):
2294 * bindings/runtime_root.h:
2295 (KJS::Bindings::RootObject::~RootObject):
2296 (KJS::Bindings::RootObject::setRootObjectImp):
2297 * kjs/collector.cpp:
2298 (KJS::Collector::allocate):
2299 (KJS::Collector::collect):
2302 (NumberImp::create):
2303 (InterpreterImp::globalInit):
2304 (InterpreterImp::globalClear):
2305 (InterpreterImp::mark):
2307 (KJS::List::derefValues):
2308 (KJS::List::refValues):
2309 (KJS::List::append):
2311 (KJS::ObjectImp::setInternalValue):
2312 (KJS::ObjectImp::putDirect):
2317 (KJS::ValueImp::ValueImp):
2318 (KJS::ValueImp::~ValueImp):
2320 (KJS::Value::Value):
2321 (KJS::Value::~Value):
2322 (KJS::Value::operator=):
2324 2004-04-30 Richard Williamson <rjw@apple.com>
2326 Asking an NSInvocation for it's return value when return type
2327 is void throws an exception. Added check for void return types
2328 to avoid this exception.
2332 * bindings/objc/objc_instance.mm:
2333 (ObjcInstance::invokeMethod):
2335 2004-04-29 Richard Williamson <rjw@apple.com>
2337 Fixed several bad problems with the ObjC bindings. In particular, conversion
2338 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2342 * bindings/objc/objc_jsobject.h:
2343 * bindings/objc/objc_jsobject.mm:
2344 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2345 (-[JavaScriptObject KJS::]):
2346 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2347 (-[JavaScriptObject call:arguments:]):
2348 (-[JavaScriptObject evaluate:]):
2349 (-[JavaScriptObject getMember:]):
2350 (-[JavaScriptObject getSlot:]):
2351 * bindings/objc/objc_runtime.mm:
2352 (ObjcField::valueFromInstance):
2353 (ObjcField::setValueToInstance):
2354 * bindings/objc/objc_utility.mm:
2355 (KJS::Bindings::convertValueToObjcValue):
2356 (KJS::Bindings::convertObjcValueToValue):
2357 * bindings/runtime.h:
2358 * bindings/runtime_root.cpp:
2359 (KJS::Bindings::rootForInterpreter):
2360 (KJS::Bindings::addNativeReference):
2361 (KJS::Bindings::removeNativeReference):
2362 * bindings/runtime_root.h:
2363 * bindings/testbindings.mm:
2364 (-[MyFirstInterface logMessage:]):
2365 (-[MyFirstInterface setJSObject:]):
2366 (-[MyFirstInterface callJSObject::]):
2368 2004-04-24 Darin Adler <darin@apple.com>
2372 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2375 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2379 Implementation of conservative GC, based partly on code from
2380 Darin. It's turned off for now, so it shouldn't have any effect on
2383 * JavaScriptCore.pbproj/project.pbxproj:
2384 * kjs/collector.cpp:
2385 (KJS::Collector::markStackObjectsConservatively):
2386 (KJS::Collector::markProtectedObjects):
2387 (KJS::Collector::collect):
2392 * kjs/protected_values.cpp: Added.
2393 (KJS::ProtectedValues::getProtectCount):
2394 (KJS::ProtectedValues::increaseProtectCount):
2395 (KJS::ProtectedValues::insert):
2396 (KJS::ProtectedValues::decreaseProtectCount):
2397 (KJS::ProtectedValues::expand):
2398 (KJS::ProtectedValues::shrink):
2399 (KJS::ProtectedValues::rehash):
2400 (KJS::ProtectedValues::computeHash):
2401 * kjs/protected_values.h: Added.
2403 (ValueImp::useConservativeMark):
2411 2004-04-22 Richard Williamson <rjw@apple.com>
2413 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2416 * bindings/npruntime.h:
2418 2004-04-22 Richard Williamson <rjw@apple.com>
2420 Updated plugin binding API to reflect latest revision from
2423 Biggest change is the introduction of NPVariant used to represent
2424 value types. NPVariant replaces the use of NPObject for the
2425 exchange of values between scripting environment and native code.
2429 * JavaScriptCore.pbproj/project.pbxproj:
2430 * bindings/NP_jsobject.cpp:
2431 (identiferFromNPIdentifier):
2437 (NPN_GetPropertyAtIndex):
2438 (NPN_SetPropertyAtIndex):
2439 * bindings/c/c_class.cpp:
2440 (CClass::methodsNamed):
2441 (CClass::fieldNamed):
2442 * bindings/c/c_instance.cpp:
2443 (CInstance::invokeMethod):
2444 (CInstance::defaultValue):
2445 * bindings/c/c_runtime.cpp:
2446 (CField::valueFromInstance):
2447 (CField::setValueToInstance):
2448 * bindings/c/c_utility.cpp:
2449 (convertNPStringToUTF16):
2450 (convertUTF8ToUTF16):
2451 (coerceValueToNPVariantStringType):
2452 (convertValueToNPVariant):
2453 (convertNPVariantToValue):
2454 * bindings/c/c_utility.h:
2455 * bindings/npruntime.cpp:
2456 (NPN_GetIdentifier):
2457 (NPN_GetIdentifiers):
2458 (NPN_UTF8FromIdentifier):
2459 (NPN_VariantIsVoid):
2460 (NPN_VariantIsNull):
2461 (NPN_VariantIsUndefined):
2462 (NPN_VariantIsBool):
2463 (NPN_VariantIsInt32):
2464 (NPN_VariantIsDouble):
2465 (NPN_VariantIsString):
2466 (NPN_VariantIsObject):
2467 (NPN_VariantToBool):
2468 (NPN_VariantToString):
2469 (NPN_VariantToInt32):
2470 (NPN_VariantToDouble):
2471 (NPN_VariantToObject):
2472 (NPN_InitializeVariantAsVoid):
2473 (NPN_InitializeVariantAsNull):
2474 (NPN_InitializeVariantAsUndefined):
2475 (NPN_InitializeVariantWithBool):
2476 (NPN_InitializeVariantWithInt32):
2477 (NPN_InitializeVariantWithDouble):
2478 (NPN_InitializeVariantWithString):
2479 (NPN_InitializeVariantWithStringCopy):
2480 (NPN_InitializeVariantWithObject):
2481 (NPN_InitializeVariantWithVariant):
2482 (NPN_ReleaseVariantValue):
2485 (NPN_ReleaseObject):
2486 (NPN_IsKindOfClass):
2487 (NPN_SetExceptionWithUTF8):
2489 * bindings/npruntime.h:
2491 (_NPString::_NPVariant::):
2492 * bindings/testbindings.cpp:
2507 2004-04-22 Darin Adler <darin@apple.com>
2511 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2514 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2515 Was resulting in a buffer 2x the needed size.
2516 (KJS::UString::expandPreCapacity): Ditto.
2517 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2519 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2523 Preliminary change for conservative GC. Create "protected"
2524 subclasses to GC-protect objects when on heap, since we will soon
2525 remove the built-in refcounting of the normal wrapper classes. Use
2528 * JavaScriptCore.pbproj/project.pbxproj:
2531 (KJS::InterpreterImp::globalObject):
2532 * kjs/interpreter.h:
2533 * kjs/property_map.cpp:
2535 * kjs/reference_list.cpp:
2537 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2541 Optimize prepend using the shared substring optimization. Also,
2542 limit the applicability of shared append and shared prepend. If
2543 you overdo it, it does more harm than good, because you create a
2544 bunch of strings that are disqualified from future shared
2545 append/prepend, for not much immediate savings in allocate/copy
2550 (KJS::UString::Rep::create):
2551 (KJS::UString::expandedSize):
2552 (KJS::UString::usedPreCapacity):
2553 (KJS::UString::expandCapacity):
2554 (KJS::UString::expandPreCapacity):
2555 (KJS::UString::UString):
2556 (KJS::UString::append):
2557 (KJS::UString::operator=):
2559 (KJS::UString::Rep::data):
2561 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2562 Reviewed by Richard.
2564 No more need for Completion or Reference to privately inherit from
2565 Value, none of the superclass functionality is used.
2572 2004-04-16 Richard Williamson <rjw@apple.com>
2574 Added interpreter lock protection around object creation.
2578 * bindings/runtime.cpp:
2579 (Instance::createRuntimeObject):
2581 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2585 Another JavaScript speed improvement: use the mechanism from
2586 string append optimization to make taking a substring fast, again
2589 A further 22% improvement on the 24fun string speed test.
2593 (KJS::UString::Rep::create):
2594 (KJS::UString::UString):
2595 (KJS::UString::append):
2596 (KJS::UString::operator=):
2597 (KJS::UString::substr):
2599 (KJS::UString::Rep::data):
2601 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2605 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2606 - fixed <rdar://problem/3600691>: Table generation test is really slow
2607 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2609 80% speedup on the string test, lesser speedups on the other two.
2611 Two different optimizations here:
2613 1) Avoid large overhead of scanning strings to see if they are all
2614 ASCII before numeric conversion.
2617 (AssignNode::evaluate): Don't convert to integer until we know for
2618 sure the operation will need it. Attempting to convert strings to
2619 numbers is a waste when they are being appended with +=.
2621 2) Avoid huge cost of appending strings.
2623 This is done by allowing multiple strings to share a buffer but
2624 actually use different ranges of it. The first time a string is
2625 appended to, we start leaving at least 10% extra space in the
2626 buffer, so doing N appends to the same string takes O(log N)
2627 mallocs instead of O(N).
2629 * kjs/identifier.cpp:
2630 (KJS::Identifier::equal):
2631 (KJS::Identifier::add):
2634 (KJS::UCharReference::operator=):
2635 (KJS::UCharReference::ref):
2636 (KJS::UString::Rep::create):
2637 (KJS::UString::Rep::destroy):
2638 (KJS::UString::expandedSize):
2639 (KJS::UString::usedCapacity):
2640 (KJS::UString::expandCapacity):
2641 (KJS::UString::UString):
2642 (KJS::UString::null):
2643 (KJS::UString::append):
2644 (KJS::UString::operator=):
2645 (KJS::UString::toStrictUInt32):
2646 (KJS::UString::detach):
2647 (KJS::KJS::operator==):
2649 (KJS::UString::Rep::data):
2650 (KJS::UString::Rep::hash):
2652 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2656 - fix deployment build by avoiding deployment-only warning.
2658 * kjs/scope_chain.cpp:
2659 (KJS::ScopeChain::bottom):
2661 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2665 Changed things so that newly created objects get a prototype based
2666 on the scope chain of the current function, rather than the
2667 interpreter that started execution. This fixes the following bugs:
2669 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2670 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2672 * JavaScriptCore.pbproj/project.pbxproj:
2673 * kjs/array_object.cpp:
2674 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2675 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2676 (ArrayProtoFuncImp::call):
2677 (ArrayObjectImp::construct):
2678 * kjs/bool_object.cpp:
2679 (BooleanObjectImp::construct):
2680 * kjs/date_object.cpp:
2681 (DateProtoFuncImp::DateProtoFuncImp):
2682 (DateProtoFuncImp::call):
2683 (DateObjectImp::construct):
2684 * kjs/error_object.cpp:
2685 (ErrorObjectImp::construct):
2687 (FunctionImp::FunctionImp):
2688 (FunctionImp::call):
2689 (DeclaredFunctionImp::construct):
2690 (ArgumentsImp::ArgumentsImp):
2691 (GlobalFuncImp::call):
2692 * kjs/function_object.cpp:
2693 (FunctionProtoFuncImp::call):
2694 (FunctionObjectImp::construct):
2696 (BooleanImp::toObject):
2697 (StringImp::toObject):
2698 (NumberImp::toObject):
2699 (InterpreterImp::InterpreterImp):
2700 (InterpreterImp::clear):
2701 (InterpreterImp::interpreterWithGlobalObject):
2703 * kjs/interpreter.cpp:
2704 (ExecState::lexicalInterpreter):
2705 * kjs/interpreter.h:
2706 (KJS::ExecState::dynamicInterpreter):
2707 (KJS::ExecState::interpreter):
2708 * kjs/math_object.cpp:
2709 (MathFuncImp::MathFuncImp):
2711 (StatementNode::hitStatement):
2712 (StatementNode::abortStatement):
2713 (RegExpNode::evaluate):
2714 (ElementNode::evaluate):
2715 (ArrayNode::evaluate):
2716 (ObjectLiteralNode::evaluate):
2717 (PropertyValueNode::evaluate):
2718 (FunctionCallNode::evaluate):
2719 (FuncDeclNode::processFuncDecl):
2720 (FuncExprNode::evaluate):
2721 * kjs/number_object.cpp:
2722 (NumberObjectImp::construct):
2724 (KJS::ObjectImp::defaultValue):
2725 (KJS::Error::create):
2726 * kjs/object_object.cpp:
2727 (ObjectObjectImp::construct):
2728 * kjs/reference.cpp:
2729 (Reference::putValue):
2730 * kjs/regexp_object.cpp:
2731 (RegExpProtoFuncImp::call):
2732 (RegExpObjectImp::arrayOfMatches):
2733 (RegExpObjectImp::construct):
2734 * kjs/scope_chain.cpp:
2735 (KJS::ScopeChain::bottom):
2736 * kjs/scope_chain.h:
2737 * kjs/string_object.cpp:
2738 (StringProtoFuncImp::StringProtoFuncImp):
2739 (StringProtoFuncImp::call):
2740 (StringObjectImp::construct):
2746 2004-03-31 Richard Williamson <rjw@apple.com>
2748 Tedious renames based on feedback from plugin-futures list.
2749 NP_ functions are renamed with NPN_ prefix.
2750 Types prefix renamed from NP_ to NP.
2751 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2753 No review because this was just a renaming patch.
2755 * bindings/NP_jsobject.cpp:
2758 (identiferFromNPIdentifier):
2763 (NPN_RemoveProperty):
2765 (NPN_GetPropertyAtIndex):
2766 (NPN_SetPropertyAtIndex):
2767 * bindings/NP_jsobject.h:
2768 * bindings/c/c_class.cpp:
2769 (CClass::_commonInit):
2770 (CClass::classForIsA):
2772 (CClass::methodsNamed):
2773 (CClass::fieldNamed):
2774 * bindings/c/c_class.h:
2775 * bindings/c/c_instance.cpp:
2776 (CInstance::CInstance):
2777 (CInstance::~CInstance):
2778 (CInstance::operator=):
2779 (CInstance::invokeMethod):
2780 (CInstance::defaultValue):
2781 * bindings/c/c_instance.h:
2782 (KJS::Bindings::CInstance::getObject):
2783 * bindings/c/c_runtime.cpp:
2784 (CField::valueFromInstance):
2785 (CField::setValueToInstance):
2786 * bindings/c/c_runtime.h:
2787 (KJS::Bindings::CField::CField):
2788 (KJS::Bindings::CField::name):
2789 (KJS::Bindings::CMethod::CMethod):
2790 (KJS::Bindings::CMethod::name):
2791 * bindings/c/c_utility.cpp:
2792 (coerceValueToNPString):
2793 (convertValueToNPValueType):
2794 (convertNPValueTypeToValue):
2795 * bindings/c/c_utility.h:
2796 * bindings/npruntime.cpp:
2797 (NPN_IdentifierFromUTF8):
2798 (NPN_IsValidIdentifier):
2799 (NPN_GetIdentifiers):
2800 (NPN_UTF8FromIdentifier):
2803 (NPN_ReleaseObject):
2804 (NPN_IsKindOfClass):
2805 (NPN_SetExceptionWithUTF8):
2808 (NPN_CreateNumberWithInt):
2809 (NPN_CreateNumberWithFloat):
2810 (NPN_CreateNumberWithDouble):
2811 (NPN_IntFromNumber):
2812 (NPN_FloatFromNumber):
2813 (NPN_DoubleFromNumber):
2815 (NPN_CreateStringWithUTF8):
2816 (NPN_CreateStringWithUTF16):
2817 (NPN_DeallocateUTF8):
2818 (NPN_UTF8FromString):
2819 (NPN_UTF16FromString):
2822 (NPN_CreateBoolean):
2823 (NPN_BoolFromBoolean):
2826 (undefinedAllocate):
2832 (NPN_ObjectAtIndex):
2833 * bindings/npruntime.h:
2834 * bindings/runtime.cpp:
2835 (Instance::createBindingForLanguageInstance):
2836 * bindings/testbindings.cpp:
2837 (initializeIdentifiers):
2857 2004-03-31 Richard Williamson <rjw@apple.com>
2859 Changed references to NP_runtime.h to npruntime.h
2861 * JavaScriptCore.pbproj/project.pbxproj:
2862 * bindings/NP_jsobject.h:
2863 * bindings/c/c_class.h:
2864 * bindings/c/c_instance.h:
2865 * bindings/c/c_runtime.h:
2866 * bindings/c/c_utility.h:
2867 * bindings/npruntime.cpp:
2869 2004-03-31 Richard Williamson <rjw@apple.com>
2871 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2873 * JavaScriptCore.pbproj/project.pbxproj:
2874 * bindings/NP_jsobject.h:
2875 * bindings/npruntime.cpp:
2879 2004-03-23 Richard Williamson <rjw@apple.com>
2881 Added implementation of KJS::Value <-> NP_Object conversion functions.
2882 Augmented test program for 'C' bindings.
2883 Added asserts and parameter checking to all public API.
2887 * JavaScriptCore.pbproj/project.pbxproj:
2888 * bindings/NP_jsobject.cpp:
2890 * bindings/NP_jsobject.h: Added.
2891 * bindings/NP_runtime.cpp:
2892 (NP_IdentifierFromUTF8):
2893 (NP_IsValidIdentifier):
2894 (NP_GetIdentifiers):
2899 (NP_SetExceptionWithUTF8):
2902 (NP_FloatFromNumber):
2903 (NP_DoubleFromNumber):
2904 (NP_CreateStringWithUTF8):
2905 (NP_CreateStringWithUTF16):
2906 (NP_DeallocateUTF8):
2907 (NP_UTF8FromString):
2908 (NP_UTF16FromString):
2910 (NP_BoolFromBoolean):
2911 * bindings/NP_runtime.h:
2912 * bindings/c/c_instance.cpp:
2913 (CInstance::invokeMethod):
2914 * bindings/c/c_utility.cpp:
2915 (coerceValueToNPString):
2916 (convertValueToNPValueType):
2917 (convertNPValueTypeToValue):
2918 * bindings/c/c_utility.h:
2920 * bindings/testC.js: Added.
2921 * bindings/testbindings.cpp:
2931 (myInterfaceInvoke):
2932 (myInterfaceAllocate):
2936 2004-03-19 Darin Adler <darin@apple.com>
2940 - fixed problem with methods like setUTCHour
2942 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2943 GMT vs. local time function based on the utc flag.
2945 2004-03-17 Richard Williamson <rjw@apple.com>
2947 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2951 * bindings/NP_jsobject.cpp:
2956 (NP_GetPropertyAtIndex):
2957 * bindings/NP_runtime.h:
2959 2004-03-16 Richard Williamson <rjw@apple.com>
2961 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.
2965 * bindings/jni/jni_class.cpp:
2966 (JavaClass::methodsNamed):
2968 2004-03-15 Richard Williamson <rjw@apple.com>
2970 Fixed 3570854. Don't attempt to convert Null to strings. We
2971 were incorrectly converting to "Null".
2973 Actually fixed by Scott Kovatch.
2975 Reviewed by Richard.
2977 * bindings/jni/jni_utility.cpp:
2978 (KJS::Bindings::convertValueToJValue):
2982 2004-03-11 Richard Williamson <rjw@apple.com>
2984 Stitched together the NP stuff to our language independent
2985 JavaScript binding stuff. Very close to being done.
2987 Added program to test C bindings (and NP stuff). Just tests
2988 properties. Will add methods and JavaScript access, etc.
2990 Updated Makefile.am to account for new bindings/c directory.
2992 Change NP_UTF8 from "const char *" to "char" to allow for
2993 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
2996 Added NP_IsValidIdentifier().
3000 * JavaScriptCore.pbproj/project.pbxproj:
3002 * bindings/NP_jsobject.cpp:
3003 (identiferFromNPIdentifier):
3005 * bindings/NP_runtime.cpp:
3006 (NP_IdentifierFromUTF8):
3007 (NP_IsValidIdentifier):
3008 (NP_GetIdentifiers):
3009 (NP_UTF8FromIdentifier):
3010 (NP_SetExceptionWithUTF8):
3012 (NP_CreateStringWithUTF8):
3013 (NP_CreateStringWithUTF16):
3014 (NP_UTF8FromString):
3015 (NP_UTF16FromString):
3016 * bindings/NP_runtime.h:
3017 * bindings/c/c_class.cpp: Added.
3018 (CClass::_commonDelete):
3019 (CClass::_commonCopy):
3020 (CClass::_commonInit):
3021 (_createClassesByIsAIfNecessary):
3022 (CClass::classForIsA):
3025 (CClass::methodsNamed):
3026 (CClass::fieldNamed):
3027 * bindings/c/c_class.h: Added.
3028 (KJS::Bindings::CClass::~CClass):
3029 (KJS::Bindings::CClass::CClass):
3030 (KJS::Bindings::CClass::operator=):
3031 (KJS::Bindings::CClass::constructorAt):
3032 (KJS::Bindings::CClass::numConstructors):
3033 * bindings/c/c_instance.cpp: Added.
3034 (CInstance::CInstance):
3035 (CInstance::~CInstance):
3036 (CInstance::operator=):
3037 (CInstance::getClass):
3040 (CInstance::invokeMethod):
3041 (CInstance::defaultValue):
3042 (CInstance::stringValue):
3043 (CInstance::numberValue):
3044 (CInstance::booleanValue):
3045 (CInstance::valueOf):
3046 * bindings/c/c_instance.h: Added.
3047 (KJS::Bindings::CInstance::getObject):
3048 * bindings/c/c_runtime.cpp: Added.
3049 (CField::valueFromInstance):
3050 (CField::setValueToInstance):
3051 * bindings/c/c_runtime.h: Added.
3052 (KJS::Bindings::CField::CField):
3053 (KJS::Bindings::CField::name):
3054 (KJS::Bindings::CField::type):
3055 (KJS::Bindings::CMethod::CMethod):
3056 (KJS::Bindings::CMethod::name):
3057 (KJS::Bindings::CMethod::numParameters):
3058 * bindings/c/c_utility.cpp: Added.
3059 (coerceValueToNPValueType):
3060 (convertValueToNPValueType):
3061 (convertNPValueTypeToValue):
3062 * bindings/c/c_utility.h: Added.
3063 * bindings/make_testbindings:
3064 * bindings/runtime.cpp:
3065 (Instance::createBindingForLanguageInstance):
3066 * bindings/runtime.h:
3067 (KJS::Bindings::Instance::):
3068 * bindings/testbindings.cpp: Added.
3069 (initializeIdentifiers):
3070 (myInterfaceHasProperty):
3071 (myInterfaceHasMethod):
3072 (myInterfaceGetProperty):
3073 (myInterfaceSetProperty):
3074 (myInterfaceInvoke):
3075 (myInterfaceAllocate):
3076 (myInterfaceInvalidate):
3077 (myInterfaceDeallocate):
3078 (GlobalImp::className):
3079 (readJavaScriptFromFile):
3082 2004-03-10 Richard Williamson <rjw@apple.com>
3084 Made changes to support new asychronous approach to calls from
3085 plugin to JavaScript
3089 * bindings/NP_jsobject.cpp:
3094 (NP_GetPropertyAtIndex):
3095 * bindings/NP_runtime.h:
3096 * bindings/make_testbindings:
3097 * bindings/runtime.cpp:
3098 (Instance::createBindingForLanguageInstance):
3100 2004-03-10 Richard Williamson <rjw@apple.com>
3102 Updated header to include proposed changes from
3103 plugin-futures list. Calls from plugin to JavaScript
3104 are now asynchronous.
3108 * bindings/NP_runtime.h:
3112 2004-03-04 Richard Williamson <rjw@apple.com>
3114 Implementation of NP_JavaScriptObject. This is the 'C' class
3115 that wraps a JavaScript object.
3119 * JavaScriptCore.pbproj/project.pbxproj:
3120 * bindings/NP_jsobject.cpp: Added.
3121 (coerceValueToNPValueType):
3122 (convertValueToNPValueType):
3123 (convertNPValueTypeToValue):
3127 (identiferFromNPIdentifier):
3132 (NP_RemoveProperty):
3134 (NP_GetPropertyAtIndex):
3135 (NP_SetPropertyAtIndex):
3136 * bindings/NP_runtime.cpp:
3138 * bindings/NP_runtime.h:
3139 * bindings/runtime_object.h:
3141 2004-03-04 Richard Williamson <rjw@apple.com>
3143 Added NP_Array implementation.
3145 Changed NP_Boolean to just depend on two static instances, no
3146 space is required for values.
3150 * bindings/NP_runtime.cpp:
3152 (NP_BoolFromBoolean):
3158 * bindings/NP_runtime.h:
3160 2004-03-03 Darin Adler <darin@apple.com>
3164 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3165 copyright string, and that's all that was in here.
3166 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3168 2004-03-03 Richard Williamson <rjw@apple.com>
3170 More 'C' binding implementation. Fleshed out all the
3171 'primitive' data types.
3175 * bindings/NP_runtime.cpp:
3180 (NP_CreateStringWithUTF8):
3181 (NP_CreateStringWithUTF16):
3182 (NP_UTF8FromString):
3183 (NP_UTF16FromString):
3186 (booleanDeallocate):
3188 (NP_BoolFromBoolean):
3192 (undefinedAllocate):
3193 (undefinedDeallocate):
3195 * bindings/NP_runtime.h:
3197 2004-03-03 Richard Williamson <rjw@apple.com>
3199 More 'C' binding implementation.
3203 * bindings/NP_runtime.cpp:
3206 (getIdentifierDictionary):
3207 (NP_IdentifierFromUTF8):
3208 (NP_UTF8FromIdentifier):
3213 (NP_CreateNumberWithInt):
3214 (NP_CreateNumberWithFloat):
3215 (NP_CreateNumberWithDouble):
3217 (NP_FloatFromNumber):
3218 (NP_DoubleFromNumber):
3219 * bindings/NP_runtime.h:
3221 2004-03-02 Richard Williamson <rjw@apple.com>
3223 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3224 own customer retain/release scheme.
3228 * bindings/NP_runtime.cpp:
3231 * bindings/NP_runtime.h:
3233 2004-03-02 Richard Williamson <rjw@apple.com>
3235 C binding API. Partial implementation.
3237 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.
3239 Factored root object reference counting scheme. It is now useful independent
3244 * JavaScriptCore.pbproj/project.pbxproj:
3245 * bindings/NP_runtime.cpp: Added.
3246 (NP_IdentifierFromUTF8):
3247 (NP_GetIdentifiers):
3248 (NP_UTF8FromIdentifier):
3258 (NP_RemoveProperty):
3260 (NP_GetPropertyAtIndex):
3261 (NP_SetPropertyAtIndex):
3262 (NP_CreateNumberWithInt):
3263 (NP_CreateNumberWithFloat):
3264 (NP_CreateNumberWithDouble):
3266 (NP_FloatFromNumber):
3267 (NP_DoubleFromNumber):
3268 (NP_CreateStringWithUTF8):
3269 (NP_CreateStringWithUTF16):
3270 (NP_UTF8FromString):
3271 (NP_UTF16FromString):
3273 (NP_BoolFromBoolean):
3279 * bindings/NP_runtime.h: Added.
3280 * bindings/jni/jni_jsobject.cpp:
3282 (JSObject::finalize):
3283 (JSObject::createNative):
3284 (JSObject::convertValueToJObject):
3285 * bindings/jni/jni_jsobject.h:
3286 * bindings/objc/objc_jsobject.h:
3287 * bindings/objc/objc_jsobject.mm:
3289 (windowJavaScriptObject):
3290 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3291 (-[JavaScriptObject dealloc]):
3292 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3293 (-[JavaScriptObject call:arguments:]):
3294 (-[JavaScriptObject evaluate:]):
3295 (-[JavaScriptObject getMember:]):
3296 (-[JavaScriptObject setMember:value:]):
3297 (-[JavaScriptObject removeMember:]):
3298 (-[JavaScriptObject toString]):
3299 (-[JavaScriptObject getSlot:]):
3300 (-[JavaScriptObject setSlot:value:]):
3301 * bindings/objc/objc_utility.h:
3302 * bindings/objc/objc_utility.mm:
3303 (KJS::Bindings::convertValueToObjcValue):
3304 * bindings/runtime_root.cpp: Added.
3305 (getReferencesByRootDictionary):
3306 (getReferencesDictionary):
3307 (KJS::Bindings::findReferenceDictionary):
3308 (KJS::Bindings::rootForImp):
3309 (KJS::Bindings::addNativeReference):
3310 (KJS::Bindings::removeNativeReference):
3311 (completedJavaScriptAccess):
3312 (initializeJavaScriptAccessLock):
3313 (lockJavaScriptAccess):
3314 (unlockJavaScriptAccess):
3315 (RootObject::dispatchToJavaScriptThread):
3316 (performJavaScriptAccess):
3317 (RootObject::setFindRootObjectForNativeHandleFunction):
3318 (RootObject::removeAllNativeReferences):
3319 * bindings/runtime_root.h: Added.
3320 (KJS::Bindings::RootObject::RootObject):
3321 (KJS::Bindings::RootObject::~RootObject):
3322 (KJS::Bindings::RootObject::setRootObjectImp):
3323 (KJS::Bindings::RootObject::rootObjectImp):
3324 (KJS::Bindings::RootObject::setInterpreter):
3325 (KJS::Bindings::RootObject::interpreter):
3326 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3327 (KJS::Bindings::RootObject::runLoop):
3328 (KJS::Bindings::RootObject::performJavaScriptSource):
3334 2004-02-18 Richard Williamson <rjw@apple.com>
3336 Added NSNumber/Number conversion.
3338 Removed some unnecessary KJS:: namespace specifiers.
3342 * bindings/objc/objc_utility.mm:
3343 (KJS::Bindings::convertValueToObjcValue):
3344 (KJS::Bindings::convertObjcValueToValue):
3345 * bindings/runtime_array.h:
3347 2004-02-18 Richard Williamson <rjw@apple.com>
3349 Added support for export NSArrays.
3351 Updated valueAt() to take an ExecState so we can throw
3354 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
3355 ObjectiveC classes to control the visibility of their methods in
3360 * bindings/jni/jni_runtime.cpp:
3361 (JavaField::valueFromInstance):
3362 (JavaArray::valueAt):
3363 * bindings/jni/jni_runtime.h:
3364 * bindings/objc/objc_class.mm:
3365 (ObjcClass::methodsNamed):
3366 * bindings/objc/objc_runtime.h:
3367 (KJS::Bindings::ObjcArray::getObjcArray):
3368 * bindings/objc/objc_runtime.mm:
3369 (ObjcField::valueFromInstance):
3370 (ObjcField::setValueToInstance):
3371 (ObjcArray::ObjcArray):
3372 (ObjcArray::~ObjcArray):
3373 (ObjcArray::operator=):
3374 (ObjcArray::setValueAt):
3375 (ObjcArray::valueAt):
3376 (ObjcArray::getLength):
3377 * bindings/objc/objc_utility.mm:
3378 (KJS::Bindings::convertValueToObjcValue):
3379 (KJS::Bindings::convertObjcValueToValue):
3380 * bindings/runtime.cpp:
3381 (Instance::getValueOfField):
3382 * bindings/runtime.h:
3383 * bindings/runtime_array.cpp:
3384 (RuntimeArrayImp::get):
3385 * bindings/runtime_object.cpp:
3386 (RuntimeObjectImp::get):
3388 2004-02-17 Richard Williamson <rjw@apple.com>
3390 Added String <-> NSString conversion.
3391 Added tests of String <-> NSString conversion to test program.
3395 * bindings/objc/objc_utility.mm:
3396 (KJS::Bindings::convertValueToObjcValue):
3397 (KJS::Bindings::convertObjcValueToValue):
3399 * bindings/testbindings.mm:
3400 (-[MyFirstInterface getString]):
3402 2004-02-15 Darin Adler <darin@apple.com>
3406 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3407 and removing redundant settings of things that match defaults in other build styles.
3409 2004-02-13 Richard Williamson <rjw@apple.com>
3411 Work towards the JavaScript ObjC bindings. The bindings now work for
3412 simple scalar types. testbindings.mm is an illustration of how the
3417 * JavaScriptCore.pbproj/project.pbxproj:
3419 * bindings/jni/jni_class.cpp:
3420 (JavaClass::methodsNamed):
3421 * bindings/jni/jni_class.h:
3422 * bindings/jni/jni_instance.cpp:
3423 (JavaInstance::invokeMethod):
3424 * bindings/jni/jni_instance.h:
3425 * bindings/jni/jni_runtime.h:
3426 (KJS::Bindings::JavaMethod::returnType):
3427 * bindings/make_testbindings: Added.
3428 * bindings/objc/objc_class.h: Added.
3429 (KJS::Bindings::ObjcClass::~ObjcClass):
3430 (KJS::Bindings::ObjcClass::ObjcClass):
3431 (KJS::Bindings::ObjcClass::operator=):
3432 (KJS::Bindings::ObjcClass::constructorAt):
3433 (KJS::Bindings::ObjcClass::numConstructors):
3434 * bindings/objc/objc_class.mm: Added.
3435 (ObjcClass::_commonDelete):
3436 (ObjcClass::_commonCopy):
3437 (ObjcClass::_commonInit):
3438 (_createClassesByIsAIfNecessary):
3439 (ObjcClass::classForIsA):
3440 (ObjcClass::ObjcClass):
3442 (ObjcClass::methodsNamed):
3443 (ObjcClass::fieldNamed):
3444 * bindings/objc/objc_header.h: Added.
3445 * bindings/objc/objc_instance.h: Added.
3446 (KJS::Bindings::ObjcInstance::getObject):
3447 * bindings/objc/objc_instance.mm: Added.
3448 (ObjcInstance::ObjcInstance):
3449 (ObjcInstance::~ObjcInstance):
3450 (ObjcInstance::operator=):
3451 (ObjcInstance::begin):
3452 (ObjcInstance::end):
3453 (ObjcInstance::getClass):
3454 (ObjcInstance::invokeMethod):
3455 (ObjcInstance::defaultValue):
3456 (ObjcInstance::stringValue):
3457 (ObjcInstance::numberValue):
3458 (ObjcInstance::booleanValue):
3459 (ObjcInstance::valueOf):
3460 * bindings/objc/objc_jsobject.h: Added.
3461 * bindings/objc/objc_jsobject.mm: Added.
3462 * bindings/objc/objc_runtime.h:
3463 (KJS::Bindings::ObjcField::~ObjcField):
3464 (KJS::Bindings::ObjcField::ObjcField):
3465 (KJS::Bindings::ObjcField::operator=):
3466 (KJS::Bindings::ObjcMethod::ObjcMethod):
3467 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3468 (KJS::Bindings::ObjcMethod::operator=):
3469 * bindings/objc/objc_runtime.mm: Added.
3470 (ObjcMethod::ObjcMethod):
3472 (ObjcMethod::numParameters):
3473 (ObjcMethod::getMethodSignature):
3474 (ObjcField::ObjcField):
3477 (ObjcField::valueFromInstance):
3478 (ObjcField::setValueToInstance):
3479 * bindings/objc/objc_utility.h: Added.
3481 * bindings/objc/objc_utility.mm: Added.
3482 (KJS::Bindings::JSMethodNameToObjCMethodName):
3483 (KJS::Bindings::convertValueToObjcValue):
3484 (KJS::Bindings::convertObjcValueToValue):
3485 (KJS::Bindings::objcValueTypeForType):
3486 * bindings/runtime.cpp:
3487 (MethodList::MethodList):
3488 (MethodList::operator=):
3489 (Instance::setValueOfField):
3490 (Instance::createBindingForLanguageInstance):
3491 (Instance::createRuntimeObject):
3492 * bindings/runtime.h:
3493 * bindings/runtime_method.cpp:
3494 (RuntimeMethodImp::RuntimeMethodImp):
3495 (RuntimeMethodImp::get):
3496 (RuntimeMethodImp::call):
3497 * bindings/runtime_method.h:
3498 * bindings/runtime_object.cpp:
3499 (RuntimeObjectImp::get):
3500 (RuntimeObjectImp::hasProperty):
3501 * bindings/test.js: Added.
3502 * bindings/testbindings.mm: Added.
3503 (-[MySecondInterface init]):
3504 (-[MyFirstInterface init]):
3505 (-[MyFirstInterface dealloc]):
3506 (+[MyFirstInterface JavaScriptNameForSelector:]):
3507 (-[MyFirstInterface getInt]):
3508 (-[MyFirstInterface setInt:]):
3509 (-[MyFirstInterface getMySecondInterface]):
3510 (-[MyFirstInterface logMessage:]):
3511 (GlobalImp::className):
3512 (readJavaScriptFromFile):
3517 2004-02-08 Darin Adler <darin@apple.com>
3521 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3523 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3524 macros from working right in C++ code that uses the <cctype> header.
3527 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3528 (KJS::UTF8SequenceLengthNonASCII): Added.
3529 (KJS::inlineUTF8SequenceLength): Added.
3530 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3531 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3532 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3533 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3534 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3536 - fixed the test program so it won't hit the interpreter lock assertion
3538 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3542 2004-02-06 Richard Williamson <rjw@apple.com>
3544 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.
3548 * bindings/jni/jni_jsobject.cpp:
3549 (JSObject::toString):
3550 * bindings/jni/jni_utility.cpp:
3551 (KJS::Bindings::convertValueToJValue):
3553 2004-02-02 Darin Adler <darin@apple.com>
3557 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3559 * kjs/array_object.cpp:
3560 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3561 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3562 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3563 number is out of range. This prevents new Array(-1) from causing trouble.
3565 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3567 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3568 casting to int. Results now match those in other browsers.
3570 2004-02-02 Darin Adler <darin@apple.com>
3574 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")