3 2005-01-13 Vicki Murley <vicki@apple.com>
7 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
9 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
11 2005-01-12 Richard Williamson <rjw@apple.com>
13 Avoid additional work on dealloc by adding early out to
14 removeNativeReference(). (This will save time on dealloc
15 for all ObjC DOM objects.)
19 * bindings/runtime_root.cpp:
20 (KJS::Bindings::removeNativeReference):
22 2005-01-12 Richard Williamson <rjw@apple.com>
24 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
26 We were always returning the first "root" object for all runtime
27 objects. Changed 0 in loop to i, the index.
29 Reviewed by David Harrison.
31 * bindings/runtime_root.cpp:
32 (KJS::Bindings::rootForImp):
34 2005-01-11 Richard Williamson <rjw@apple.com>
36 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
38 Use the new dispatching API to invoke JNI, rather than calling JNI
41 Reviewed by David Harrison.
43 * bindings/jni/jni_instance.cpp:
44 (JavaInstance::invokeMethod):
45 * bindings/jni/jni_runtime.cpp:
46 (JavaField::dispatchValueFromInstance):
47 (JavaField::valueFromInstance):
48 (JavaField::dispatchSetValueToInstance):
49 (JavaField::setValueToInstance):
50 * bindings/jni/jni_runtime.h:
51 * bindings/jni/jni_utility.cpp:
52 (KJS::Bindings::convertValueToJValue):
60 2004-12-17 Maciej Stachowiak <mjs@apple.com>
64 <rdar://problem/3926869> Opening caches window after running PLT causes crash
66 * kjs/protected_values.cpp:
67 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
68 the protected value table.
69 (KJS::ProtectedValues::increaseProtectCount): Ditto.
70 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
72 2004-12-16 Darin Adler <darin@apple.com>
76 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
78 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
79 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
80 non-locale-specific versions.
81 * kjs/string_object.lut.h: Regenerated.
83 2004-12-14 Richard Williamson <rjw@apple.com>
85 Pass URL of plugin view when call into JNI.
89 * bindings/jni/jni_objc.mm:
90 (KJS::Bindings::dispatchJNICall):
92 2004-12-13 Richard Williamson <rjw@apple.com>
94 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
96 Add support for calling static Java methods from JavaScript.
100 * bindings/jni/jni_instance.cpp:
101 (JavaInstance::invokeMethod):
102 * bindings/jni/jni_runtime.cpp:
103 (JavaMethod::JavaMethod):
104 * bindings/jni/jni_runtime.h:
105 (KJS::Bindings::JavaMethod::isStatic):
106 * bindings/jni/jni_utility.cpp:
107 (callJNIStaticMethod):
108 (KJS::Bindings::callJNIBooleanMethod):
109 (KJS::Bindings::callJNIStaticBooleanMethod):
110 * bindings/jni/jni_utility.h:
112 2004-12-13 Richard Williamson <rjw@apple.com>
114 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
118 * bindings/jni/jni_instance.cpp:
119 (JavaInstance::invokeMethod):
120 * bindings/jni/jni_objc.mm:
121 (KJS::Bindings::dispatchJNICall):
122 * bindings/jni/jni_runtime.h:
123 * bindings/jni/jni_utility.h:
127 2004-12-07 Maciej Stachowiak <mjs@apple.com>
131 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
133 The fix was to implement copy constructor and assignment operator,
134 the ones that worked on the base class did not replace the
138 (KJS::ProtectedValue::ProtectedValue):
139 (KJS::ProtectedValue::operator=):
140 (KJS::ProtectedObject::ProtectedObject):
141 (KJS::ProtectedObject::operator=):
143 Also fixed a bug in the GC test mode that compares the results of
144 the old collector and the new collector.
151 2004-11-23 Richard Williamson <rjw@apple.com>
153 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
157 * bindings/c/c_class.cpp:
158 (CClass::_commonInit):
160 2004-11-21 Maciej Stachowiak <mjs@apple.com>
164 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
167 (KJS::Collector::Thread::Thread):
168 (KJS::destroyRegisteredThread):
169 (KJS::initializeRegisteredThreadKey):
170 (KJS::Collector::registerThread):
171 (KJS::Collector::markStackObjectsConservatively):
172 (KJS::Collector::markCurrentThreadConservatively):
173 (KJS::Collector::markOtherThreadConservatively):
181 2004-11-15 Richard Williamson <rjw@apple.com>
183 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
187 * bindings/objc/objc_instance.mm:
188 (ObjcInstance::stringValue):
189 * bindings/objc/objc_utility.h:
190 * bindings/objc/objc_utility.mm:
191 (KJS::Bindings::convertNSStringToString):
192 (KJS::Bindings::convertObjcValueToValue):
196 2004-11-09 Chris Blumenberg <cblu@apple.com>
198 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
203 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
204 * bindings/softlinking.c: Added.
206 (getFunctionPointer): new
207 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
211 2004-11-04 Darin Adler <darin@apple.com>
215 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
216 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
217 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
218 than allocating a new one
220 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
221 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
222 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
223 actually allocate only the very first time it's called.
224 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
225 shared instance since there can be only one).
226 (-[WebUndefined copyWithZone:]): Ditto.
227 (-[WebUndefined retain]): Ditto.
228 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
230 (-[WebUndefined autorelease]): Simplified to just return self (see above).
231 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
232 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
233 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
234 bug mentioned above).
235 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
236 No need to call init, since that's a no-op for this class.
238 2004-11-03 David Harrison <harrison@apple.com>
242 Eliminate the use of a marker file to determine how to build.
247 2004-11-01 Richard Williamson <rjw@apple.com>
249 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
253 * bindings/c/c_instance.cpp:
254 (CInstance::invokeMethod):
255 (CInstance::invokeDefaultMethod):
256 Initialize out parameters to void type.
258 * bindings/c/c_runtime.cpp:
259 (CField::valueFromInstance):
260 (CField::setValueToInstance):
261 Initialize out parameters to void type.
262 Also added additional checks to protect against classes that
263 don't implement all functions.
265 2004-11-01 Richard Williamson <rjw@apple.com>
267 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
272 * bindings/objc/WebScriptObject.mm:
273 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
274 Added additional conversion Undefined -> WebUndefined.
275 * bindings/objc/objc_utility.mm:
276 (KJS::Bindings::convertObjcValueToValue):
277 Added additional conversion WebUndefined -> Undefined.
279 2004-11-01 Darin Adler <darin@apple.com>
281 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
283 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
284 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
285 report to match the contents of the file.
291 2004-10-22 Ken Kocienda <kocienda@apple.com>
295 * JavaScriptCore.pbproj/project.pbxproj:
296 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
300 2004-10-13 Richard Williamson <rjw@apple.com>
302 Moved boolean checks prior to NSNumber checks. booleans are
305 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
309 * bindings/objc/objc_utility.mm:
310 (KJS::Bindings::convertObjcValueToValue):
312 2004-10-12 Richard Williamson <rjw@apple.com>
314 Fixed access to DOM object via WebScriptObject API.
315 The execution context for DOM objects wasn't being found.
316 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
320 * bindings/objc/WebScriptObject.mm:
322 (-[WebScriptObject KJS::Bindings::]):
323 (-[WebScriptObject callWebScriptMethod:withArguments:]):
324 (-[WebScriptObject evaluateWebScript:]):
325 (-[WebScriptObject setValue:forKey:]):
326 (-[WebScriptObject valueForKey:]):
327 (-[WebScriptObject stringRepresentation]):
328 * bindings/objc/WebScriptObjectPrivate.h:
330 2004-10-09 Darin Adler <darin@apple.com>
334 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
336 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
337 creating an init routine.
339 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
340 require a global constructor that creates an init routine.
342 2004-10-09 Darin Adler <darin@apple.com>
346 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
348 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
349 work with the window object of the page the function is in, not the page of the caller. This
350 is what all other browsers do. This code was hidden before by the "everything is defined on
351 window object" hack in WebCore.
353 2004-10-07 Richard Williamson <rjw@apple.com>
355 Added simple JavaScript call tracing. Very useful for
356 debugging complex pages.
358 Tracing is only available in development builds and is
361 (gdb) set traceJavaScript = 1
365 setTraceJavaScript(true)
367 Function, args, and return values are printed to console. Very
372 * kjs/function_object.cpp:
373 (FunctionProtoFuncImp::call):
379 2004-10-05 Richard Williamson <rjw@apple.com>
381 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
385 * bindings/NP_jsobject.cpp:
387 * bindings/npruntime.cpp:
388 (_NPN_SetExceptionWithUTF8):
389 * bindings/objc/WebScriptObject.mm:
390 (+[WebScriptObject throwException:]):
392 (KJS::InterpreterImp::context):
394 2004-10-05 Richard Williamson <rjw@apple.com>
396 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
400 * bindings/objc/objc_utility.mm:
401 (KJS::Bindings::convertObjcValueToValue):
403 2004-10-04 Darin Adler <darin@apple.com>
407 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
409 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
411 - rolled out an old workaround we don't need any more
413 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
414 required it is no longer there.
416 2004-09-30 Richard Williamson <rjw@apple.com>
418 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
422 * bindings/NP_jsobject.cpp:
426 * bindings/c/c_class.cpp:
427 (CClass::methodsNamed):
428 (CClass::fieldNamed):
429 * bindings/c/c_class.h:
430 * bindings/c/c_instance.cpp:
431 (CInstance::invokeMethod):
432 * bindings/jni/jni_class.cpp:
433 (JavaClass::methodsNamed):
434 * bindings/jni/jni_class.h:
435 * bindings/npruntime.h:
436 * bindings/objc/objc_class.h:
437 * bindings/objc/objc_class.mm:
438 (ObjcClass::methodsNamed):
439 * bindings/runtime.h:
440 * bindings/runtime_object.cpp:
441 (RuntimeObjectImp::get):
442 (RuntimeObjectImp::hasProperty):
444 2004-09-29 Chris Blumenberg <cblu@apple.com>
446 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.
450 * JavaScriptCore.pbproj/project.pbxproj:
451 * bindings/NP_jsobject.cpp:
452 (_NPN_CreateScriptObject):
453 (_NPN_InvokeDefault):
458 (_NPN_RemoveProperty):
461 * bindings/c/c_class.cpp:
462 (CClass::methodsNamed):
463 (CClass::fieldNamed):
464 * bindings/c/c_instance.cpp:
465 (CInstance::CInstance):
466 (CInstance::~CInstance):
467 (CInstance::operator=):
468 (CInstance::invokeMethod):
469 (CInstance::invokeDefaultMethod):
470 * bindings/c/c_runtime.cpp:
471 * bindings/c/c_runtime.h:
472 (KJS::Bindings::CField::name):
473 (KJS::Bindings::CMethod::name):
474 * bindings/npruntime.cpp:
475 (_NPN_GetStringIdentifier):
476 (_NPN_GetStringIdentifiers):
477 (_NPN_GetIntIdentifier):
478 (_NPN_IdentifierIsString):
479 (_NPN_UTF8FromIdentifier):
480 (_NPN_IntFromIdentifier):
481 (NPN_InitializeVariantWithObject):
482 (_NPN_ReleaseVariantValue):
485 (_NPN_ReleaseObject):
486 (_NPN_SetExceptionWithUTF8):
489 2004-09-26 Darin Adler <darin@apple.com>
491 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
492 low() to get Unicode value of character, and just use unicode().
494 2004-09-26 Darin Adler <darin@apple.com>
496 - refine charAt/charCodeAt fix slightly
498 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
499 omitted parameter, as we do everywhere else, and as other browsers do here.
501 2004-09-26 Darin Adler <darin@apple.com>
505 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
507 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
508 the program. We were doing this properly for functions, but not entire programs.
510 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
512 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
513 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
515 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
521 2004-09-14 Richard Williamson <rjw@apple.com>
523 1. Add class parameter to object allocation function. This is somewhat redundant, given that
524 the allocation function is in the class function vector, but people wanted to use the same
525 allocation function for different classes.
527 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
529 3. Add support for a default function on an object. This is a feature that ActiveX supports,
530 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
531 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
532 'Objective-C' bindings.
534 There bugs are covered by
536 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
537 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
538 <rdar://problem/3674754> Need to implement latest npruntime.h
542 * bindings/NP_jsobject.cpp:
546 * bindings/c/c_class.cpp:
547 * bindings/c/c_instance.cpp:
548 (CInstance::CInstance):
549 (CInstance::operator=):
550 (CInstance::invokeMethod):
551 (CInstance::invokeDefaultMethod):
552 * bindings/c/c_instance.h:
553 * bindings/c/c_runtime.cpp:
554 * bindings/c/c_runtime.h:
555 * bindings/jni/jni_instance.cpp:
556 (JavaInstance::invokeDefaultMethod):
557 * bindings/jni/jni_instance.h:
558 * bindings/npruntime.cpp:
560 * bindings/npruntime.h:
561 * bindings/objc/WebScriptObject.h:
562 * bindings/objc/objc_class.mm:
563 (ObjcClass::fallbackObject):
564 * bindings/objc/objc_instance.h:
565 * bindings/objc/objc_instance.mm:
566 (ObjcInstance::invokeDefaultMethod):
567 * bindings/objc/objc_runtime.h:
568 * bindings/objc/objc_runtime.mm:
569 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
570 (ObjcFallbackObjectImp::get):
571 (ObjcFallbackObjectImp::put):
572 (ObjcFallbackObjectImp::canPut):
573 (ObjcFallbackObjectImp::implementsCall):
574 (ObjcFallbackObjectImp::call):
575 (ObjcFallbackObjectImp::hasProperty):
576 (ObjcFallbackObjectImp::deleteProperty):
577 (ObjcFallbackObjectImp::defaultValue):
578 * bindings/runtime.h:
579 (KJS::Bindings::Class::fallbackObject):
580 (KJS::Bindings::Instance::getValueOfUndefinedField):
581 (KJS::Bindings::Instance::setValueOfUndefinedField):
582 (KJS::Bindings::Instance::valueOf):
583 * bindings/runtime_object.cpp:
584 (RuntimeObjectImp::implementsCall):
585 (RuntimeObjectImp::call):
586 * bindings/runtime_object.h:
588 2004-09-13 Maciej Stachowiak <mjs@apple.com>
592 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
594 * kjs/string_object.cpp:
595 (StringProtoFuncImp::call): Replaced implementation of replace()
596 method with function below...
597 (replace): In order to avoid excessive allocation and copying,
598 figure out the ranges of the original string and replacement
599 strings to be assembled, instead of constantly creating new
600 strings at each substitution. The old behavior is basically O(N^2)
601 for a global replace on a pattern that matches many places in the
603 (regExpIsGlobal): Helper function for the above.
604 (expandSourceRanges): ditto
605 (pushSourceRange): ditto
606 (expandReplacements): ditto
607 (pushReplacement): ditto
609 (KJS::UString::spliceSubstringsWithSeparators): New method that
610 pieces together substring ranges of this string together with
611 specified separators, all at one go.
613 (KJS::UString::Range::Range): Added new helper class to represent
616 2004-09-14 Maciej Stachowiak <mjs@apple.com>
620 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
623 (KJS::GlobalFuncImp::call): Make sure to escape null
624 characters. This is a bug in the new code that made part of the
627 2004-09-13 Darin Adler <darin@apple.com>
629 Reviewed by Kevin and Maciej.
631 - new function to support fix for DIG bug in WebCore
633 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
634 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
636 2004-09-12 Darin Adler <darin@apple.com>
638 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
639 of escape and unescape.
641 2004-09-12 Darin Adler <darin@apple.com>
645 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
647 * kjs/date_object.cpp:
648 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
649 uses CFDateFormatter.
650 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
652 2004-09-09 Maciej Stachowiak <mjs@apple.com>
656 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
659 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
660 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
662 (Lexer::isHexDigit): Made static and non-const.
667 2004-09-06 Darin Adler <darin@apple.com>
669 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
673 2004-09-01 Richard Williamson <rjw@apple.com>
675 Add pid to exception messages (to help debug dashboard clients).
679 * kjs/interpreter.cpp:
680 (Interpreter::evaluate):
684 2004-08-20 Richard Williamson <rjw@apple.com>
686 Implemented new JNI abstraction. We no longer invoke Java methods
687 directly with JNI, rather we call into the plugin. This allows the
688 plugin to dispatch the call to the appropriate VM thread. This
689 change should (will?) fix a whole class of threading related problems with
694 * JavaScriptCore.pbproj/project.pbxproj:
695 * bindings/c/c_instance.h:
696 (KJS::Bindings::CInstance::setExecutionContext):
697 (KJS::Bindings::CInstance::executionContext):
698 * bindings/jni/jni_instance.cpp:
699 (JavaInstance::JavaInstance):
700 (JavaInstance::invokeMethod):
701 (JavaInstance::setExecutionContext):
702 (JavaInstance::executionContext):
703 * bindings/jni/jni_instance.h:
704 * bindings/jni/jni_jsobject.cpp:
705 (JSObject::convertJObjectToValue):
706 * bindings/jni/jni_runtime.cpp:
707 (JavaField::JavaField):
708 (JavaArray::convertJObjectToArray):
709 (JavaField::valueFromInstance):
710 (JavaArray::JavaArray):
711 (JavaArray::valueAt):
712 * bindings/jni/jni_runtime.h:
713 (KJS::Bindings::JavaArray::operator=):
714 (KJS::Bindings::JavaArray::executionContext):
715 * bindings/jni/jni_utility.h:
716 * bindings/objc/objc_instance.h:
717 (KJS::Bindings::ObjcInstance::setExecutionContext):
718 (KJS::Bindings::ObjcInstance::executionContext):
719 * bindings/runtime.cpp:
720 (Instance::createBindingForLanguageInstance):
721 * bindings/runtime.h:
722 * bindings/runtime_root.h:
723 (KJS::Bindings::RootObject::nativeHandle):
727 2004-08-19 Vicki Murley <vicki@apple.com>
731 * kjs/property_map.cpp:
732 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
734 2004-08-17 Darin Adler <darin@apple.com>
738 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
740 * kjs/property_map.h: Added some private functions.
741 * kjs/property_map.cpp:
742 (KJS::PropertyMap::clear): Set sentinelCount to 0.
743 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
744 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
745 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
746 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
747 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
748 deleted-element sentinels.
749 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
751 2004-08-16 Maciej Stachowiak <mjs@apple.com>
753 Code change by Eric Albert, reviewd by me.
755 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
757 * kjs/date_object.cpp:
758 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
759 entirely would be even better, but is not required to fix this bug.
763 2004-08-16 Richard Williamson <rjw@apple.com>
765 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
767 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
771 * bindings/NP_jsobject.cpp:
773 * bindings/jni/jni_jsobject.cpp:
775 * bindings/objc/WebScriptObject.mm:
776 (-[WebScriptObject evaluateWebScript:]):
778 2004-08-15 Richard Williamson <rjw@apple.com>
780 More updates to np headers. Implemented new NPN functions.
784 * bindings/NP_jsobject.cpp:
788 * bindings/npruntime.h:
790 2004-08-13 Darin Adler <darin@apple.com>
792 - fix build so we can compile again
794 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
795 is good enough so that we can compile, but it's only a stopgap measure, because I think
796 Richard has a newer one he wants to check in.
798 2004-08-12 Richard Williamson <rjw@apple.com>
800 Bring npruntime.h and friends closer to compliance with
805 * JavaScriptCore.pbproj/project.pbxproj:
806 * bindings/NP_jsobject.cpp:
808 (_NPN_CreateScriptObject):
813 (NPN_RemoveProperty):
814 * bindings/NP_jsobject.h:
815 * bindings/c/c_instance.cpp:
816 (CInstance::invokeMethod):
817 * bindings/c/c_utility.cpp:
818 (convertNPVariantToValue):
819 * bindings/npruntime.cpp:
820 (NPN_IdentifierIsString):
823 (NPN_VariantIsUndefined):
825 (NPN_VariantIsInt32):
826 (NPN_VariantIsDouble):
827 (NPN_VariantIsString):
828 (NPN_VariantIsObject):
830 (NPN_VariantToString):
831 (NPN_VariantToInt32):
832 (NPN_VariantToDouble):
833 (NPN_VariantToObject):
834 (NPN_InitializeVariantAsVoid):
835 (NPN_InitializeVariantAsNull):
836 (NPN_InitializeVariantAsUndefined):
837 (NPN_InitializeVariantWithBool):
838 (NPN_InitializeVariantWithInt32):
839 (NPN_InitializeVariantWithDouble):
840 (NPN_InitializeVariantWithString):
841 (NPN_InitializeVariantWithStringCopy):
842 (NPN_InitializeVariantWithObject):
843 (NPN_InitializeVariantWithVariant):
844 (NPN_ReleaseVariantValue):
846 * bindings/npruntime.h:
848 (_NPString::_NPVariant::):
849 * bindings/npruntime_priv.h: Added.
851 2004-08-12 Darin Adler <darin@apple.com>
855 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
858 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
859 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
860 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
861 to skip leading "+" or "-".
865 2004-08-12 Darin Adler <darin@apple.com>
869 - fixed 43 Mozilla JavaScript tests
871 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
872 * kjs/date_object.cpp:
873 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
874 than constructing a number object to pass to it.
875 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
876 (KJS::parseDate): Change to return a double instead of creating the Number object here.
877 (KJS::timeClip): Implement this as specified in the language standard.
879 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
880 flags on the prototype property.
883 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
885 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
887 (KJS::parseDigit): Added. Helper function for parseInt.
888 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
889 strtoll can handle. Also matches standard more closely.
890 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
892 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
894 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
896 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
898 (Lexer::setCode): Clear error state.
899 (Lexer::lex): Set error state if the lexer encounters an error
902 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
903 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
905 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
906 Change round to round values between -0.5 and -0 to -0 instead of +0.
908 * kjs/nodes.h: Add evaluateReference function to GroupNode.
909 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
910 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
911 would change x.y into a value that can't be deleted as a side effect.
913 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
916 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
917 get rid of the fixed size limit for code.
919 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
920 returns the string without creating a new Rep, since I'm using substr in a place where it will
923 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
924 the other day that was making a couple tests fail.
925 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
926 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
927 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
928 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
929 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
931 * kjs/string_object.lut.h: Regenerated.
933 2004-08-11 Darin Adler <darin@apple.com>
935 - fixed a tiny problem with the UTF-16 PCRE check-in
937 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
938 the ctype_meta flag to get set in items that should not have it.
940 * pcre/chartables.c: Regenerated.
942 2004-08-10 Richard Williamson <rjw@apple.com>
944 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
946 The following WebScripting methods are now supported on bound
949 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
950 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
951 - (id)valueForUndefinedKey:(NSString *)key
955 * bindings/c/c_class.cpp:
956 (CClass::fieldNamed):
957 * bindings/c/c_class.h:
958 * bindings/jni/jni_class.cpp:
959 (JavaClass::fieldNamed):
960 * bindings/jni/jni_class.h:
961 * bindings/objc/objc_class.h:
962 (KJS::Bindings::ObjcClass::isa):
963 * bindings/objc/objc_class.mm:
964 (ObjcClass::methodsNamed):
965 (ObjcClass::fieldNamed):
966 (ObjcClass::fallbackObject):
967 * bindings/objc/objc_instance.h:
968 * bindings/objc/objc_instance.mm:
969 (ObjcInstance::invokeMethod):
970 (ObjcInstance::setValueOfField):
971 (ObjcInstance::setValueOfUndefinedField):
972 (ObjcInstance::getValueOfField):
973 (ObjcInstance::getValueOfUndefinedField):
974 * bindings/objc/objc_runtime.h:
975 (KJS::Bindings::ObjcField::~ObjcField):
976 (KJS::Bindings::ObjcField::ObjcField):
977 (KJS::Bindings::ObjcField::operator=):
978 (KJS::Bindings::FallbackObjectImp::classInfo):
979 * bindings/objc/objc_runtime.mm:
980 (ObjcField::ObjcField):
983 (ObjcField::valueFromInstance):
984 (ObjcField::setValueToInstance):
985 (FallbackObjectImp::FallbackObjectImp):
986 (FallbackObjectImp::get):
987 (FallbackObjectImp::put):
988 (FallbackObjectImp::canPut):
989 (FallbackObjectImp::implementsCall):
990 (FallbackObjectImp::call):
991 (FallbackObjectImp::hasProperty):
992 (FallbackObjectImp::deleteProperty):
993 (FallbackObjectImp::defaultValue):
994 * bindings/runtime.h:
995 (KJS::Bindings::Class::fallbackObject):
996 (KJS::Bindings::Instance::getValueOfUndefinedField):
997 (KJS::Bindings::Instance::setValueOfUndefinedField):
998 * bindings/runtime_object.cpp:
999 (RuntimeObjectImp::get):
1000 (RuntimeObjectImp::put):
1001 (RuntimeObjectImp::canPut):
1002 (RuntimeObjectImp::hasProperty):
1003 * bindings/testbindings.mm:
1004 (-[MyFirstInterface valueForUndefinedKey:]):
1005 (-[MyFirstInterface setValue:forUndefinedKey:]):
1007 2004-08-10 Darin Adler <darin@apple.com>
1011 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1013 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1014 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1015 that need to use it.
1016 * pcre/pcre.c: Add UTF-16 support to all functions.
1017 * pcre/study.c: Ditto.
1019 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1020 the mode. Changed declarations to use symbolic constants and typedefs so we size
1021 things to ichar when needed.
1023 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1024 sized to 16-bit characters instead of 8-bit.
1027 (pcre_copy_substring): Use pcre_char instead of char.
1028 (pcre_get_substring_list): Ditto.
1029 (pcre_free_substring_list): Ditto.
1030 (pcre_get_substring): Ditto.
1031 (pcre_free_substring): Ditto.
1033 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1034 of hard-coding 8-bit table sizes.
1036 * pcre/chartables.c: Regenerated.
1038 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1039 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1040 is not null. The null string still has a null pointer. This prevents us from
1041 passing a null through to the regular expression engine (which results in a null
1042 error even when the string length is 0).
1045 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1046 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1048 2004-08-09 Darin Adler <darin@apple.com>
1052 - fixed 28 Mozilla JavaScript tests
1054 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1055 checking the number of arguments for the join method.
1057 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1058 than integers, so we aren't limited to 32 bits.
1060 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1061 the implementation of the pow operation. Also simplied a case that was handling positive
1062 and negative infinity separately.
1064 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1065 putting them in a long, so that unsigned shift will work properly.
1067 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1069 * kjs/operations.cpp:
1070 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1071 sign of isinf; our isinf function returns +1 even for negative infinity.
1072 (KJS::isNegInf): And again.
1073 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1074 Our floating point already handles the various infinity cases correctly.
1076 * kjs/regexp_object.cpp:
1077 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1078 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1079 array in cases where we did not match.
1080 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1081 "global", "ignoreCase", "multiline", and "source".
1083 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1084 string into undefined rather than an empty string. For the slice method, handle an
1085 undefined parameter for the limit properly as decribed in the specification, and add
1086 the limit to one case that didn't have the limit at all. For the methods that generate
1087 HTML strings, use lowercase tags instead of uppercase.
1090 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1091 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1092 (KJS::UString::append): Fix some math that caused a buffer overflow.
1093 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1094 flag) rather than converting them all to 0.
1095 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1097 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1099 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1100 the Unicode specification in a few cases where it was wrong before.
1101 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1102 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1103 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1104 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1105 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1106 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1107 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1108 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1109 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1111 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1113 * kjs/number_object.lut.h: Regenerated.
1115 2004-08-09 Darin Adler <darin@apple.com>
1119 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1121 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1122 we get a buffer overflow.
1126 2004-08-05 Richard Williamson <rjw@apple.com>
1128 Fixed part of 3674747. The QT guys need this for feature freeze.
1130 This patch implements support for the
1132 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1134 method of objects bound to JavaScript.
1139 * bindings/objc/objc_class.mm:
1140 (ObjcClass::methodsNamed):
1141 (ObjcClass::fieldNamed):
1142 * bindings/objc/objc_instance.mm:
1143 (ObjcInstance::invokeMethod):
1144 * bindings/objc/objc_runtime.h:
1145 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1146 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1147 (KJS::Bindings::ObjcMethod::javaScriptName):
1148 * bindings/objc/objc_runtime.mm:
1149 (ObjcMethod::ObjcMethod):
1150 (ObjcMethod::getMethodSignature):
1151 (ObjcMethod::setJavaScriptName):
1152 * bindings/testbindings.mm:
1154 2004-08-04 Vicki Murley <vicki@apple.com>
1158 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1161 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1162 go to the next line and continue parsing the string (instead of failing). This matches
1163 behavior in Mac IE and Mozilla.
1165 2004-08-03 Kevin Decker <kdecker@apple.com>
1169 Rolled in changes from the latest KJS sources that support additional
1170 Number.prototype functions.
1172 Specifically this patch covers the follow parts of the ECMA 3 spec:
1173 15.7.4.5, 15.7.4.6, and 15.7.4.7
1176 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1177 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1178 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1180 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1181 list of supported identifiers (a macro).
1182 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1183 and toExponential().
1184 (NumberPrototypeImp::NumberPrototypeImp):
1185 (NumberProtoFuncImp::call):
1186 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1188 (KJS::NumberProtoFuncImp::):
1189 * tests/mozilla/expected.html: Update results.
1191 2004-08-03 Darin Adler <darin@apple.com>
1195 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1197 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1198 we are supposed to just copy the regular expression object, and do so.
1199 Also tighten up arguments check to handle case where an actual "undefined"
1200 is passed rather than just omitting an argument.
1202 * tests/mozilla/expected.html: Update results.
1204 2004-08-02 Darin Adler <darin@apple.com>
1206 * tests/mozilla/.cvsignore: Added.
1207 * tests/mozilla/expected.html: Update results.
1209 2004-08-02 Darin Adler <darin@apple.com>
1213 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1215 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1216 Append the flags here so more tests paseed.
1218 2004-08-02 Darin Adler <darin@apple.com>
1222 - fixed a couple things making 5 Mozilla regexp tests pass
1224 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1226 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1227 be used as the flags string when no parameter was passed.
1229 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1230 Added a class info object for RegExp prototype so it can return
1231 a string instead of raising an exception when converting to a string.
1233 * tests/mozilla/expected.html: Update results.
1235 2004-08-02 Darin Adler <darin@apple.com>
1239 - fix crashes in mozilla tests due to mishandling NaN
1241 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1242 calls to toInteger so that NaN will get turned into something that fits in an integer.
1243 These were the ones John already fixed, but his fix used isnan and the new fix is
1246 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1247 after a call to toInteger to handle NaN properly. Also removed separate check
1248 for undefined that's not needed.
1250 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1251 as in the above two files, but for a lot more functions. Also changed one place with
1252 an explicit check for undefined to instead just check isNaN.
1254 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1255 like me who don't keep $SYMROOTS in their $PATH.
1261 2004-07-26 Kevin Decker <kdecker@apple.com>
1263 Changes done by Darin, reviewed by Kevin.
1265 - changed testkjs to build in Xcode rather than from Makefile
1267 * .cvsignore: Removed obsolete files from this list.
1268 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1269 Changed to build target "All" rather than default target. This makes us
1270 build the testkjs test tool.
1271 * dummy.cpp: Removed.
1272 * kjs/.cvsignore: Removed obsolete files from this list, including
1273 the testkjs tool, which is now built in the symroots directory.
1274 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1275 changed this file. Also this has the nice side effect of causing the tool
1276 to be rebuilt in the new location even if there are no other changes in
1277 your tree when you check this out.
1278 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1279 without setting the execute bit on jsDriver.pl.
1281 2004-07-22 Kevin Decker <kdecker@apple.com>
1285 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1287 * kjs/function_object.cpp:
1288 (FunctionObjectImp::construct):
1289 * kjs/function_object.h:
1291 (KJS::ObjectImp::construct):
1293 (KJS::Object::construct):
1295 2004-07-21 Darin Adler <darin@apple.com>
1297 * bindings/npruntime.h: Fixed typo.
1299 2004-07-19 John Sullivan <sullivan@apple.com>
1303 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1304 vulnerability in my patch for 3714644
1306 * kjs/array_object.cpp:
1307 (ArrayProtoFuncImp::call):
1308 handle NAN parameters passed to slice() by clamping to 0 and length.
1310 2004-07-19 Richard Williamson <rjw@apple.com>
1312 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1317 * bindings/jni/jni_jsobject.cpp:
1319 (JSObject::JSObject):
1321 2004-07-16 John Sullivan <sullivan@apple.com>
1325 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1326 hangs browser with javascript
1328 * kjs/array_object.cpp:
1329 (ArrayProtoFuncImp::call):
1330 Check for undefined type for args[0] the same way we were already checking
1331 for args[1]. In this case, args was zero-length, but we were treating
1332 args[0] like an integer anyway. Resulted in some code looping from a NAN
1333 value to 4, taking approximately forever.
1335 * JavaScriptCore.pbproj/project.pbxproj:
1340 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1344 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1345 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1347 * kjs/number_object.cpp:
1348 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1350 2004-07-13 Kevin Decker <kdecker@apple.com>
1352 Reviewed by kocienda.
1354 - made testkjs and JavaScriptCore a subtarget of 'All'
1355 - testkjs now builds in $SYMROOTS
1357 * JavaScriptCore.pbproj/project.pbxproj:
1361 2004-06-24 Chris Blumenberg <cblu@apple.com>
1363 Ignore .mode1 files in JavaScriptCore.pbproj
1365 Reviewed by kocienda.
1367 * JavaScriptCore.pbproj/.cvsignore:
1369 2004-06-23 Richard Williamson <rjw@apple.com>
1371 Implemented changes for latest npruntime.h.
1375 * JavaScriptCore.pbproj/project.pbxproj:
1376 * bindings/NP_jsobject.cpp:
1377 (listFromVariantArgs):
1378 (identiferFromNPIdentifier):
1379 (_NPN_CreateScriptObject):
1384 (NPN_RemoveProperty):
1385 * bindings/NP_jsobject.h:
1386 * bindings/c/c_class.cpp:
1387 (CClass::methodsNamed):
1388 (CClass::fieldNamed):
1389 * bindings/c/c_instance.cpp:
1390 (CInstance::invokeMethod):
1391 * bindings/c/c_utility.cpp:
1392 (convertNPVariantToValue):
1393 * bindings/c/c_utility.h:
1394 * bindings/npruntime.cpp:
1395 (stringIdentifierEqual):
1396 (stringIdentifierHash):
1397 (getStringIdentifierDictionary):
1398 (intIdentifierEqual):
1399 (intIdentifierHash):
1400 (getIntIdentifierDictionary):
1401 (NPN_GetStringIdentifier):
1402 (NPN_GetStringIdentifiers):
1403 (NPN_GetIntIdentifier):
1404 (NPN_IdentifierIsString):
1405 (NPN_UTF8FromIdentifier):
1406 (NPN_VariantToInt32):
1407 (NPN_VariantToDouble):
1409 * bindings/npruntime.h:
1410 * bindings/objc/WebScriptObject.mm:
1411 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1412 * bindings/runtime_object.cpp:
1413 (RuntimeObjectImp::~RuntimeObjectImp):
1414 * bindings/runtime_root.cpp:
1415 (KJS::Bindings::rootForInterpreter):
1416 * bindings/testbindings.cpp:
1417 (initializeIdentifiers):
1423 === JavaScriptCore-146.1 ===
1425 2004-06-16 Richard Williamson <rjw@apple.com>
1427 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1429 This turned out to be a show stopper for Dashboard. Accessing a nil
1430 ObjC property from JS caused a crash. Similar to the problem
1431 3696112 fixed below.
1435 * bindings/objc/objc_runtime.mm:
1436 (KJS::Bindings::ObjcField::valueFromInstance):
1440 2004-06-16 Richard Williamson <rjw@apple.com>
1442 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1444 This turned out to be a show stopper for Dashboard. We now
1445 return Undefined() when nil is returned from a ObjC method
1446 that returns an object type.
1450 * bindings/objc/objc_utility.mm:
1451 (KJS::Bindings::convertObjcValueToValue):
1455 2004-06-15 Richard Williamson <rjw@apple.com>
1457 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1459 No longer need to check respondsToSelector: for
1460 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1461 because these now have a default implementation on NSObject.
1465 * bindings/objc/objc_class.mm:
1466 (ObjcClass::methodsNamed):
1467 (ObjcClass::fieldNamed):
1469 2004-06-14 Darin Adler <darin@apple.com>
1473 - fixed some things for GC that Patrick missed, or that happened after the branch
1475 * bindings/objc/WebScriptObject.mm:
1476 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1477 (-[WebScriptObject finalize]): Added.
1479 - added some missing nil checks
1481 * bindings/objc/objc_instance.mm:
1482 (ObjcInstance::ObjcInstance): Check for nil.
1483 (ObjcInstance::~ObjcInstance): Check for nil.
1484 (ObjcInstance::operator=): Check for nil.
1486 2004-06-14 Darin Adler <darin@apple.com>
1488 Reviewed by me, code changes by Patrick Beard.
1490 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1492 * bindings/objc/objc_instance.mm:
1493 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1494 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1495 (ObjcInstance::operator=): More of the same.
1496 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1498 * bindings/objc/objc_runtime.mm:
1499 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1500 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1501 (ObjcArray::operator=): More of the same.
1503 * bindings/testbindings.mm: Fixed incorrect license.
1504 (main): Use [pool drain] if compiling on Tiger.
1508 2004-06-10 Kevin Decker <kdecker@apple.com>
1514 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1516 (KJS::Lexer::lineNo):
1517 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1519 === JavaScriptCore-143.2 ===
1521 2004-06-07 Darin Adler <darin@apple.com>
1523 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1525 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1526 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1528 === JavaScriptCore-143.1 ===
1530 2004-06-04 Kevin Decker <kdecker@apple.com>
1534 - fixed <rdar://problem/3680594>
1537 (KJS::Error::create):
1541 2004-06-04 Darin Adler <darin@apple.com>
1543 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1545 2004-06-04 Kevin Decker <kdecker@apple.com>
1549 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1550 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1551 - changed the wording of an error message
1552 - the lexer, parser, and interpreter have been made "sourceURL aware"
1553 - stored the url into Error
1555 * bindings/NP_jsobject.cpp:
1557 * bindings/jni/jni_jsobject.cpp:
1559 * bindings/objc/WebScriptObject.mm:
1560 (-[WebScriptObject evaluateWebScript:]):
1562 (GlobalFuncImp::call):
1563 * kjs/function_object.cpp:
1564 (FunctionObjectImp::construct):
1567 (InterpreterImp::checkSyntax):
1568 (InterpreterImp::evaluate):
1570 * kjs/interpreter.cpp:
1571 (Interpreter::evaluate):
1572 * kjs/interpreter.h:
1576 (KJS::Lexer::sourceURL):
1580 (FunctionCallNode::evaluate):
1583 (KJS::Error::create):
1586 2004-06-04 Richard Williamson <rjw@apple.com>
1588 Fixed crash when attempting to access properties on nil
1593 * bindings/objc/objc_instance.mm:
1594 (ObjcInstance::getClass):
1595 * bindings/runtime_object.cpp:
1596 (RuntimeObjectImp::get):
1597 * bindings/testM.js:
1598 * bindings/testbindings.mm:
1599 (-[MyFirstInterface getString]):
1601 2004-05-27 Kevin Decker <kdecker@apple.com>
1605 -revised generated error message content
1607 * kjs/error_object.cpp:
1608 (ErrorProtoFuncImp::call):
1612 (KJS::Error::create):
1616 2004-05-27 Richard Williamson <rjw@apple.com>
1618 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
1622 * bindings/objc/WebScriptObject.h:
1624 2004-05-27 Darin Adler <darin@apple.com>
1628 - moved to new symlink technique for embedding frameworks
1630 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
1631 because we don't need it any more.
1633 2004-05-24 Richard Williamson <rjw@apple.com>
1635 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
1636 fixed ClassInfo to correctly reflect inheritance. This is required
1637 because of the runtime checks in JSC for arrays, i.e. in
1638 the Function objects apply method.
1642 * bindings/jni/jni_runtime.cpp:
1643 (JavaArray::convertJObjectToArray):
1644 * bindings/objc/objc_utility.mm:
1645 (KJS::Bindings::convertObjcValueToValue):
1646 * bindings/runtime_array.cpp:
1647 (RuntimeArrayImp::RuntimeArrayImp):
1648 * bindings/runtime_array.h:
1649 * bindings/testM.js: Added.
1650 * bindings/testbindings.mm:
1651 (+[MyFirstInterface webScriptNameForSelector:]):
1652 (-[MyFirstInterface logMessages:]):
1653 (-[MyFirstInterface logMessage:prefix:]):
1654 (-[MyFirstInterface callJSObject::]):
1656 2004-05-22 Darin Adler <darin@apple.com>
1660 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
1662 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
1663 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
1664 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
1665 it hasn't been set explicitly.
1669 2004-05-20 Richard Williamson <rjw@apple.com>
1671 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
1672 can now be referenced like any other WebScriptObject, meaning
1673 you can do JS operations on them.
1675 All added implementation of finalizeForWebScript.
1679 * bindings/objc/WebScriptObject.h:
1680 * bindings/objc/WebScriptObject.mm:
1681 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
1682 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1683 (-[WebScriptObject KJS::]):
1684 (-[WebScriptObject dealloc]):
1685 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1686 (-[WebScriptObject evaluateWebScript:]):
1687 (-[WebScriptObject setValue:forKey:]):
1688 (-[WebScriptObject valueForKey:]):
1689 (-[WebScriptObject stringRepresentation]):
1690 * bindings/objc/WebScriptObjectPrivate.h:
1691 * bindings/objc/objc_instance.mm:
1692 (ObjcInstance::~ObjcInstance):
1694 2004-05-19 Richard Williamson <rjw@apple.com>
1696 Removed extraneous tabs that were added (by XCode?).
1698 * bindings/objc/WebScriptObject.h:
1700 2004-05-19 Darin Adler <darin@apple.com>
1702 - fixed headers with licenses mangled by Xcode auto-indenting
1704 * bindings/jni/jni_jsobject.cpp:
1705 * bindings/jni/jni_jsobject.h:
1706 * bindings/runtime_array.h:
1707 * bindings/runtime_root.cpp:
1708 * bindings/runtime_root.h:
1710 2004-05-18 Richard Williamson <rjw@apple.com>
1712 Added exception logging. Also check for exception and
1713 set results as appropriate.
1715 Reviewed by Maciej (partially reviewed).
1717 * bindings/objc/WebScriptObject.mm:
1718 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1719 (-[WebScriptObject evaluateWebScript:]):
1720 (-[WebScriptObject setValue:forKey:]):
1721 (-[WebScriptObject valueForKey:]):
1723 2004-05-18 Richard Williamson <rjw@apple.com>
1725 Finsished implementing support for windowScriptObject.
1726 Had to make WebScriptObjectPrivate.h accessible from
1731 * JavaScriptCore.pbproj/project.pbxproj:
1732 * bindings/objc/WebScriptObjectPrivate.h:
1734 2004-05-18 Richard Williamson <rjw@apple.com>
1736 Use KVC to set/get values instead of directly accessing
1741 * bindings/objc/WebScriptObject.mm:
1742 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1743 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1744 * bindings/objc/objc_runtime.mm:
1745 (ObjcField::valueFromInstance):
1746 (convertValueToObjcObject):
1747 (ObjcField::setValueToInstance):
1749 2004-05-17 Richard Williamson <rjw@apple.com>
1751 Implemented new API for WebScriptObject.
1753 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
1754 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
1758 * JavaScriptCore.pbproj/project.pbxproj:
1759 * bindings/c/c_instance.cpp:
1760 (CInstance::invokeMethod):
1761 * bindings/jni/jni_instance.cpp:
1762 (JavaInstance::invokeMethod):
1763 * bindings/jni/jni_jsobject.cpp:
1764 (JSObject::convertValueToJObject):
1765 * bindings/jni/jni_utility.cpp:
1766 (KJS::Bindings::getJNIField):
1767 * bindings/objc/WebScriptObject.mm:
1769 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1770 (-[WebScriptObject KJS::]):
1771 (-[WebScriptObject dealloc]):
1772 (+[WebScriptObject throwException:]):
1774 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1775 (-[WebScriptObject evaluateWebScript:]):
1776 (-[WebScriptObject setValue:forKey:]):
1777 (-[WebScriptObject valueForKey:]):
1778 (-[WebScriptObject stringRepresentation]):
1779 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1780 (+[WebUndefined undefined]):
1781 (-[WebUndefined initWithCoder:]):
1782 (-[WebUndefined encodeWithCoder:]):
1783 (-[WebUndefined copyWithZone:]):
1784 (-[WebUndefined retain]):
1785 (-[WebUndefined release]):
1786 (-[WebUndefined retainCount]):
1787 (-[WebUndefined autorelease]):
1788 (-[WebUndefined dealloc]):
1789 (-[WebUndefined copy]):
1790 (-[WebUndefined replacementObjectForPortCoder:]):
1791 * bindings/objc/WebScriptObjectPrivate.h: Added.
1792 * bindings/objc/objc_class.mm:
1793 (ObjcClass::methodsNamed):
1794 (ObjcClass::fieldNamed):
1795 * bindings/objc/objc_instance.mm:
1796 (ObjcInstance::invokeMethod):
1797 * bindings/objc/objc_jsobject.h:
1798 * bindings/objc/objc_jsobject.mm:
1799 * bindings/objc/objc_runtime.mm:
1800 (ObjcField::valueFromInstance):
1801 * bindings/objc/objc_utility.mm:
1802 (KJS::Bindings::JSMethodNameToObjCMethodName):
1803 (KJS::Bindings::convertValueToObjcValue):
1804 (KJS::Bindings::convertObjcValueToValue):
1805 * bindings/runtime.cpp:
1806 (Instance::setDidExecuteFunction):
1807 (Instance::didExecuteFunction):
1808 (Instance::setValueOfField):
1809 * bindings/runtime.h:
1810 * bindings/testbindings.mm:
1811 (+[MyFirstInterface webScriptNameForSelector:]):
1812 (-[MyFirstInterface callJSObject::]):
1814 2004-05-14 Vicki Murley <vicki@apple.com>
1818 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
1820 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
1824 2004-05-13 Richard Williamson <rjw@apple.com>
1831 * bindings/objc/WebScriptObject.h:
1833 2004-05-13 Richard Williamson <rjw@apple.com>
1835 Approved API changes. Currently unimplemented.
1840 * JavaScriptCore.pbproj/project.pbxproj:
1841 * bindings/objc/WebScriptObject.h: Added.
1842 * bindings/objc/WebScriptObject.mm: Added.
1843 (+[WebScriptObject throwException:]):
1844 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1845 (-[WebScriptObject evaluateWebScript:]):
1846 (-[WebScriptObject stringRepresentation]):
1847 (+[WebUndefined undefined]):
1848 (-[WebUndefined initWithCoder:]):
1849 (-[WebUndefined encodeWithCoder:]):
1850 (-[WebUndefined copyWithZone:]):
1852 2004-05-07 Vicki Murley <vicki@apple.com>
1856 Turn off GC since it uses ppc only instructions (which breaks
1859 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
1863 2004-05-07 Maciej Stachowiak <mjs@apple.com>
1867 - add -funroll-loops=16 compiler option for approx .5% speedup on
1868 HTML iBench and .5-1% speedup on JS iBench.
1870 * JavaScriptCore.pbproj/project.pbxproj:
1872 2004-04-25 Maciej Stachowiak <mjs@apple.com>
1876 Enable full conservative GC mode in addition to test mode. When
1877 conservative GC is enabled, we now get an 11% speed improvement on
1878 the iBench. Also fix some spots I missed before.
1880 Specific noteworth changes:
1882 * kjs/collector.cpp:
1883 (KJS::Collector::markStackObjectsConservatively): Check possible
1884 cell pointers for 8-byte aligment and verify they are not 0.
1886 * kjs/protected_values.cpp:
1887 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
1888 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
1890 (KJS::gcProtectNullTolerant): ...to here...
1891 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
1892 tolerance, and doing the check is expensive.
1894 * kjs/protected_values.cpp:
1895 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
1896 that is still very good.
1901 (KJS::ProtectedValue::ProtectedValue):
1902 (KJS::ProtectedValue::~ProtectedValue):
1903 (KJS::ProtectedValue::operator=):
1904 (KJS::ProtectedObject::ProtectedObject):
1905 (KJS::ProtectedObject::~ProtectedObject):
1906 (KJS::ProtectedObject::operator=):
1907 (KJS::ProtectedReference::ProtectedReference):
1908 (KJS::ProtectedReference::~ProtectedReference):
1909 (KJS::ProtectedReference::operator=):
1910 * kjs/protected_values.cpp:
1911 (KJS::ProtectedValues::getProtectCount):
1912 (KJS::ProtectedValues::increaseProtectCount):
1913 (KJS::ProtectedValues::decreaseProtectCount):
1914 (KJS::ProtectedValues::computeHash):
1915 * bindings/runtime_root.cpp:
1916 (KJS::Bindings::addNativeReference):
1917 (KJS::Bindings::removeNativeReference):
1918 (RootObject::removeAllNativeReferences):
1919 * bindings/runtime_root.h:
1920 (KJS::Bindings::RootObject::~RootObject):
1921 (KJS::Bindings::RootObject::setRootObjectImp):
1922 * kjs/collector.cpp:
1923 (KJS::Collector::allocate):
1924 (KJS::Collector::collect):
1927 (NumberImp::create):
1928 (InterpreterImp::globalInit):
1929 (InterpreterImp::globalClear):
1930 (InterpreterImp::mark):
1932 (KJS::List::derefValues):
1933 (KJS::List::refValues):
1934 (KJS::List::append):
1936 (KJS::ObjectImp::setInternalValue):
1937 (KJS::ObjectImp::putDirect):
1942 (KJS::ValueImp::ValueImp):
1943 (KJS::ValueImp::~ValueImp):
1945 (KJS::Value::Value):
1946 (KJS::Value::~Value):
1947 (KJS::Value::operator=):
1949 2004-04-30 Richard Williamson <rjw@apple.com>
1951 Asking an NSInvocation for it's return value when return type
1952 is void throws an exception. Added check for void return types
1953 to avoid this exception.
1957 * bindings/objc/objc_instance.mm:
1958 (ObjcInstance::invokeMethod):
1960 2004-04-29 Richard Williamson <rjw@apple.com>
1962 Fixed several bad problems with the ObjC bindings. In particular, conversion
1963 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
1967 * bindings/objc/objc_jsobject.h:
1968 * bindings/objc/objc_jsobject.mm:
1969 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
1970 (-[JavaScriptObject KJS::]):
1971 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1972 (-[JavaScriptObject call:arguments:]):
1973 (-[JavaScriptObject evaluate:]):
1974 (-[JavaScriptObject getMember:]):
1975 (-[JavaScriptObject getSlot:]):
1976 * bindings/objc/objc_runtime.mm:
1977 (ObjcField::valueFromInstance):
1978 (ObjcField::setValueToInstance):
1979 * bindings/objc/objc_utility.mm:
1980 (KJS::Bindings::convertValueToObjcValue):
1981 (KJS::Bindings::convertObjcValueToValue):
1982 * bindings/runtime.h:
1983 * bindings/runtime_root.cpp:
1984 (KJS::Bindings::rootForInterpreter):
1985 (KJS::Bindings::addNativeReference):
1986 (KJS::Bindings::removeNativeReference):
1987 * bindings/runtime_root.h:
1988 * bindings/testbindings.mm:
1989 (-[MyFirstInterface logMessage:]):
1990 (-[MyFirstInterface setJSObject:]):
1991 (-[MyFirstInterface callJSObject::]):
1993 2004-04-24 Darin Adler <darin@apple.com>
1997 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2000 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2004 Implementation of conservative GC, based partly on code from
2005 Darin. It's turned off for now, so it shouldn't have any effect on
2008 * JavaScriptCore.pbproj/project.pbxproj:
2009 * kjs/collector.cpp:
2010 (KJS::Collector::markStackObjectsConservatively):
2011 (KJS::Collector::markProtectedObjects):
2012 (KJS::Collector::collect):
2017 * kjs/protected_values.cpp: Added.
2018 (KJS::ProtectedValues::getProtectCount):
2019 (KJS::ProtectedValues::increaseProtectCount):
2020 (KJS::ProtectedValues::insert):
2021 (KJS::ProtectedValues::decreaseProtectCount):
2022 (KJS::ProtectedValues::expand):
2023 (KJS::ProtectedValues::shrink):
2024 (KJS::ProtectedValues::rehash):
2025 (KJS::ProtectedValues::computeHash):
2026 * kjs/protected_values.h: Added.
2028 (ValueImp::useConservativeMark):
2036 2004-04-22 Richard Williamson <rjw@apple.com>
2038 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2041 * bindings/npruntime.h:
2043 2004-04-22 Richard Williamson <rjw@apple.com>
2045 Updated plugin binding API to reflect latest revision from
2048 Biggest change is the introduction of NPVariant used to represent
2049 value types. NPVariant replaces the use of NPObject for the
2050 exchange of values between scripting environment and native code.
2054 * JavaScriptCore.pbproj/project.pbxproj:
2055 * bindings/NP_jsobject.cpp:
2056 (identiferFromNPIdentifier):
2062 (NPN_GetPropertyAtIndex):
2063 (NPN_SetPropertyAtIndex):
2064 * bindings/c/c_class.cpp:
2065 (CClass::methodsNamed):
2066 (CClass::fieldNamed):
2067 * bindings/c/c_instance.cpp:
2068 (CInstance::invokeMethod):
2069 (CInstance::defaultValue):
2070 * bindings/c/c_runtime.cpp:
2071 (CField::valueFromInstance):
2072 (CField::setValueToInstance):
2073 * bindings/c/c_utility.cpp:
2074 (convertNPStringToUTF16):
2075 (convertUTF8ToUTF16):
2076 (coerceValueToNPVariantStringType):
2077 (convertValueToNPVariant):
2078 (convertNPVariantToValue):
2079 * bindings/c/c_utility.h:
2080 * bindings/npruntime.cpp:
2081 (NPN_GetIdentifier):
2082 (NPN_GetIdentifiers):
2083 (NPN_UTF8FromIdentifier):
2084 (NPN_VariantIsVoid):
2085 (NPN_VariantIsNull):
2086 (NPN_VariantIsUndefined):
2087 (NPN_VariantIsBool):
2088 (NPN_VariantIsInt32):
2089 (NPN_VariantIsDouble):
2090 (NPN_VariantIsString):
2091 (NPN_VariantIsObject):
2092 (NPN_VariantToBool):
2093 (NPN_VariantToString):
2094 (NPN_VariantToInt32):
2095 (NPN_VariantToDouble):
2096 (NPN_VariantToObject):
2097 (NPN_InitializeVariantAsVoid):
2098 (NPN_InitializeVariantAsNull):
2099 (NPN_InitializeVariantAsUndefined):
2100 (NPN_InitializeVariantWithBool):
2101 (NPN_InitializeVariantWithInt32):
2102 (NPN_InitializeVariantWithDouble):
2103 (NPN_InitializeVariantWithString):
2104 (NPN_InitializeVariantWithStringCopy):
2105 (NPN_InitializeVariantWithObject):
2106 (NPN_InitializeVariantWithVariant):
2107 (NPN_ReleaseVariantValue):
2110 (NPN_ReleaseObject):
2111 (NPN_IsKindOfClass):
2112 (NPN_SetExceptionWithUTF8):
2114 * bindings/npruntime.h:
2116 (_NPString::_NPVariant::):
2117 * bindings/testbindings.cpp:
2132 2004-04-22 Darin Adler <darin@apple.com>
2136 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2139 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2140 Was resulting in a buffer 2x the needed size.
2141 (KJS::UString::expandPreCapacity): Ditto.
2142 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2144 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2148 Preliminary change for conservative GC. Create "protected"
2149 subclasses to GC-protect objects when on heap, since we will soon
2150 remove the built-in refcounting of the normal wrapper classes. Use
2153 * JavaScriptCore.pbproj/project.pbxproj:
2156 (KJS::InterpreterImp::globalObject):
2157 * kjs/interpreter.h:
2158 * kjs/property_map.cpp:
2160 * kjs/reference_list.cpp:
2162 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2166 Optimize prepend using the shared substring optimization. Also,
2167 limit the applicability of shared append and shared prepend. If
2168 you overdo it, it does more harm than good, because you create a
2169 bunch of strings that are disqualified from future shared
2170 append/prepend, for not much immediate savings in allocate/copy
2175 (KJS::UString::Rep::create):
2176 (KJS::UString::expandedSize):
2177 (KJS::UString::usedPreCapacity):
2178 (KJS::UString::expandCapacity):
2179 (KJS::UString::expandPreCapacity):
2180 (KJS::UString::UString):
2181 (KJS::UString::append):
2182 (KJS::UString::operator=):
2184 (KJS::UString::Rep::data):
2186 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2187 Reviewed by Richard.
2189 No more need for Completion or Reference to privately inherit from
2190 Value, none of the superclass functionality is used.
2197 2004-04-16 Richard Williamson <rjw@apple.com>
2199 Added interpreter lock protection around object creation.
2203 * bindings/runtime.cpp:
2204 (Instance::createRuntimeObject):
2206 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2210 Another JavaScript speed improvement: use the mechanism from
2211 string append optimization to make taking a substring fast, again
2214 A further 22% improvement on the 24fun string speed test.
2218 (KJS::UString::Rep::create):
2219 (KJS::UString::UString):
2220 (KJS::UString::append):
2221 (KJS::UString::operator=):
2222 (KJS::UString::substr):
2224 (KJS::UString::Rep::data):
2226 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2230 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2231 - fixed <rdar://problem/3600691>: Table generation test is really slow
2232 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2234 80% speedup on the string test, lesser speedups on the other two.
2236 Two different optimizations here:
2238 1) Avoid large overhead of scanning strings to see if they are all
2239 ASCII before numeric conversion.
2242 (AssignNode::evaluate): Don't convert to integer until we know for
2243 sure the operation will need it. Attempting to convert strings to
2244 numbers is a waste when they are being appended with +=.
2246 2) Avoid huge cost of appending strings.
2248 This is done by allowing multiple strings to share a buffer but
2249 actually use different ranges of it. The first time a string is
2250 appended to, we start leaving at least 10% extra space in the
2251 buffer, so doing N appends to the same string takes O(log N)
2252 mallocs instead of O(N).
2254 * kjs/identifier.cpp:
2255 (KJS::Identifier::equal):
2256 (KJS::Identifier::add):
2259 (KJS::UCharReference::operator=):
2260 (KJS::UCharReference::ref):
2261 (KJS::UString::Rep::create):
2262 (KJS::UString::Rep::destroy):
2263 (KJS::UString::expandedSize):
2264 (KJS::UString::usedCapacity):
2265 (KJS::UString::expandCapacity):
2266 (KJS::UString::UString):
2267 (KJS::UString::null):
2268 (KJS::UString::append):
2269 (KJS::UString::operator=):
2270 (KJS::UString::toStrictUInt32):
2271 (KJS::UString::detach):
2272 (KJS::KJS::operator==):
2274 (KJS::UString::Rep::data):
2275 (KJS::UString::Rep::hash):
2277 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2281 - fix deployment build by avoiding deployment-only warning.
2283 * kjs/scope_chain.cpp:
2284 (KJS::ScopeChain::bottom):
2286 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2290 Changed things so that newly created objects get a prototype based
2291 on the scope chain of the current function, rather than the
2292 interpreter that started execution. This fixes the following bugs:
2294 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2295 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2297 * JavaScriptCore.pbproj/project.pbxproj:
2298 * kjs/array_object.cpp:
2299 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2300 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2301 (ArrayProtoFuncImp::call):
2302 (ArrayObjectImp::construct):
2303 * kjs/bool_object.cpp:
2304 (BooleanObjectImp::construct):
2305 * kjs/date_object.cpp:
2306 (DateProtoFuncImp::DateProtoFuncImp):
2307 (DateProtoFuncImp::call):
2308 (DateObjectImp::construct):
2309 * kjs/error_object.cpp:
2310 (ErrorObjectImp::construct):
2312 (FunctionImp::FunctionImp):
2313 (FunctionImp::call):
2314 (DeclaredFunctionImp::construct):
2315 (ArgumentsImp::ArgumentsImp):
2316 (GlobalFuncImp::call):
2317 * kjs/function_object.cpp:
2318 (FunctionProtoFuncImp::call):
2319 (FunctionObjectImp::construct):
2321 (BooleanImp::toObject):
2322 (StringImp::toObject):
2323 (NumberImp::toObject):
2324 (InterpreterImp::InterpreterImp):
2325 (InterpreterImp::clear):
2326 (InterpreterImp::interpreterWithGlobalObject):
2328 * kjs/interpreter.cpp:
2329 (ExecState::lexicalInterpreter):
2330 * kjs/interpreter.h:
2331 (KJS::ExecState::dynamicInterpreter):
2332 (KJS::ExecState::interpreter):
2333 * kjs/math_object.cpp:
2334 (MathFuncImp::MathFuncImp):
2336 (StatementNode::hitStatement):
2337 (StatementNode::abortStatement):
2338 (RegExpNode::evaluate):
2339 (ElementNode::evaluate):
2340 (ArrayNode::evaluate):
2341 (ObjectLiteralNode::evaluate):
2342 (PropertyValueNode::evaluate):
2343 (FunctionCallNode::evaluate):
2344 (FuncDeclNode::processFuncDecl):
2345 (FuncExprNode::evaluate):
2346 * kjs/number_object.cpp:
2347 (NumberObjectImp::construct):
2349 (KJS::ObjectImp::defaultValue):
2350 (KJS::Error::create):
2351 * kjs/object_object.cpp:
2352 (ObjectObjectImp::construct):
2353 * kjs/reference.cpp:
2354 (Reference::putValue):
2355 * kjs/regexp_object.cpp:
2356 (RegExpProtoFuncImp::call):
2357 (RegExpObjectImp::arrayOfMatches):
2358 (RegExpObjectImp::construct):
2359 * kjs/scope_chain.cpp:
2360 (KJS::ScopeChain::bottom):
2361 * kjs/scope_chain.h:
2362 * kjs/string_object.cpp:
2363 (StringProtoFuncImp::StringProtoFuncImp):
2364 (StringProtoFuncImp::call):
2365 (StringObjectImp::construct):
2371 2004-03-31 Richard Williamson <rjw@apple.com>
2373 Tedious renames based on feedback from plugin-futures list.
2374 NP_ functions are renamed with NPN_ prefix.
2375 Types prefix renamed from NP_ to NP.
2376 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2378 No review because this was just a renaming patch.
2380 * bindings/NP_jsobject.cpp:
2383 (identiferFromNPIdentifier):
2388 (NPN_RemoveProperty):
2390 (NPN_GetPropertyAtIndex):
2391 (NPN_SetPropertyAtIndex):
2392 * bindings/NP_jsobject.h:
2393 * bindings/c/c_class.cpp:
2394 (CClass::_commonInit):
2395 (CClass::classForIsA):
2397 (CClass::methodsNamed):
2398 (CClass::fieldNamed):
2399 * bindings/c/c_class.h:
2400 * bindings/c/c_instance.cpp:
2401 (CInstance::CInstance):
2402 (CInstance::~CInstance):
2403 (CInstance::operator=):
2404 (CInstance::invokeMethod):
2405 (CInstance::defaultValue):
2406 * bindings/c/c_instance.h:
2407 (KJS::Bindings::CInstance::getObject):
2408 * bindings/c/c_runtime.cpp:
2409 (CField::valueFromInstance):
2410 (CField::setValueToInstance):
2411 * bindings/c/c_runtime.h:
2412 (KJS::Bindings::CField::CField):
2413 (KJS::Bindings::CField::name):
2414 (KJS::Bindings::CMethod::CMethod):
2415 (KJS::Bindings::CMethod::name):
2416 * bindings/c/c_utility.cpp:
2417 (coerceValueToNPString):
2418 (convertValueToNPValueType):
2419 (convertNPValueTypeToValue):
2420 * bindings/c/c_utility.h:
2421 * bindings/npruntime.cpp:
2422 (NPN_IdentifierFromUTF8):
2423 (NPN_IsValidIdentifier):
2424 (NPN_GetIdentifiers):
2425 (NPN_UTF8FromIdentifier):
2428 (NPN_ReleaseObject):
2429 (NPN_IsKindOfClass):
2430 (NPN_SetExceptionWithUTF8):
2433 (NPN_CreateNumberWithInt):
2434 (NPN_CreateNumberWithFloat):
2435 (NPN_CreateNumberWithDouble):
2436 (NPN_IntFromNumber):
2437 (NPN_FloatFromNumber):
2438 (NPN_DoubleFromNumber):
2440 (NPN_CreateStringWithUTF8):
2441 (NPN_CreateStringWithUTF16):
2442 (NPN_DeallocateUTF8):
2443 (NPN_UTF8FromString):
2444 (NPN_UTF16FromString):
2447 (NPN_CreateBoolean):
2448 (NPN_BoolFromBoolean):
2451 (undefinedAllocate):
2457 (NPN_ObjectAtIndex):
2458 * bindings/npruntime.h:
2459 * bindings/runtime.cpp:
2460 (Instance::createBindingForLanguageInstance):
2461 * bindings/testbindings.cpp:
2462 (initializeIdentifiers):
2482 2004-03-31 Richard Williamson <rjw@apple.com>
2484 Changed references to NP_runtime.h to npruntime.h
2486 * JavaScriptCore.pbproj/project.pbxproj:
2487 * bindings/NP_jsobject.h:
2488 * bindings/c/c_class.h:
2489 * bindings/c/c_instance.h:
2490 * bindings/c/c_runtime.h:
2491 * bindings/c/c_utility.h:
2492 * bindings/npruntime.cpp:
2494 2004-03-31 Richard Williamson <rjw@apple.com>
2496 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2498 * JavaScriptCore.pbproj/project.pbxproj:
2499 * bindings/NP_jsobject.h:
2500 * bindings/npruntime.cpp:
2504 2004-03-23 Richard Williamson <rjw@apple.com>
2506 Added implementation of KJS::Value <-> NP_Object conversion functions.
2507 Augmented test program for 'C' bindings.
2508 Added asserts and parameter checking to all public API.
2512 * JavaScriptCore.pbproj/project.pbxproj:
2513 * bindings/NP_jsobject.cpp:
2515 * bindings/NP_jsobject.h: Added.
2516 * bindings/NP_runtime.cpp:
2517 (NP_IdentifierFromUTF8):
2518 (NP_IsValidIdentifier):
2519 (NP_GetIdentifiers):
2524 (NP_SetExceptionWithUTF8):
2527 (NP_FloatFromNumber):
2528 (NP_DoubleFromNumber):
2529 (NP_CreateStringWithUTF8):
2530 (NP_CreateStringWithUTF16):
2531 (NP_DeallocateUTF8):
2532 (NP_UTF8FromString):
2533 (NP_UTF16FromString):
2535 (NP_BoolFromBoolean):
2536 * bindings/NP_runtime.h:
2537 * bindings/c/c_instance.cpp:
2538 (CInstance::invokeMethod):
2539 * bindings/c/c_utility.cpp:
2540 (coerceValueToNPString):
2541 (convertValueToNPValueType):
2542 (convertNPValueTypeToValue):
2543 * bindings/c/c_utility.h:
2545 * bindings/testC.js: Added.
2546 * bindings/testbindings.cpp:
2556 (myInterfaceInvoke):
2557 (myInterfaceAllocate):
2561 2004-03-19 Darin Adler <darin@apple.com>
2565 - fixed problem with methods like setUTCHour
2567 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2568 GMT vs. local time function based on the utc flag.
2570 2004-03-17 Richard Williamson <rjw@apple.com>
2572 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2576 * bindings/NP_jsobject.cpp:
2581 (NP_GetPropertyAtIndex):
2582 * bindings/NP_runtime.h:
2584 2004-03-16 Richard Williamson <rjw@apple.com>
2586 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.
2590 * bindings/jni/jni_class.cpp:
2591 (JavaClass::methodsNamed):
2593 2004-03-15 Richard Williamson <rjw@apple.com>
2595 Fixed 3570854. Don't attempt to convert Null to strings. We
2596 were incorrectly converting to "Null".
2598 Actually fixed by Scott Kovatch.
2600 Reviewed by Richard.
2602 * bindings/jni/jni_utility.cpp:
2603 (KJS::Bindings::convertValueToJValue):
2607 2004-03-11 Richard Williamson <rjw@apple.com>
2609 Stitched together the NP stuff to our language independent
2610 JavaScript binding stuff. Very close to being done.
2612 Added program to test C bindings (and NP stuff). Just tests
2613 properties. Will add methods and JavaScript access, etc.
2615 Updated Makefile.am to account for new bindings/c directory.
2617 Change NP_UTF8 from "const char *" to "char" to allow for
2618 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
2621 Added NP_IsValidIdentifier().
2625 * JavaScriptCore.pbproj/project.pbxproj:
2627 * bindings/NP_jsobject.cpp:
2628 (identiferFromNPIdentifier):
2630 * bindings/NP_runtime.cpp:
2631 (NP_IdentifierFromUTF8):
2632 (NP_IsValidIdentifier):
2633 (NP_GetIdentifiers):
2634 (NP_UTF8FromIdentifier):
2635 (NP_SetExceptionWithUTF8):
2637 (NP_CreateStringWithUTF8):
2638 (NP_CreateStringWithUTF16):
2639 (NP_UTF8FromString):
2640 (NP_UTF16FromString):
2641 * bindings/NP_runtime.h:
2642 * bindings/c/c_class.cpp: Added.
2643 (CClass::_commonDelete):
2644 (CClass::_commonCopy):
2645 (CClass::_commonInit):
2646 (_createClassesByIsAIfNecessary):
2647 (CClass::classForIsA):
2650 (CClass::methodsNamed):
2651 (CClass::fieldNamed):
2652 * bindings/c/c_class.h: Added.
2653 (KJS::Bindings::CClass::~CClass):
2654 (KJS::Bindings::CClass::CClass):
2655 (KJS::Bindings::CClass::operator=):
2656 (KJS::Bindings::CClass::constructorAt):
2657 (KJS::Bindings::CClass::numConstructors):
2658 * bindings/c/c_instance.cpp: Added.
2659 (CInstance::CInstance):
2660 (CInstance::~CInstance):
2661 (CInstance::operator=):
2662 (CInstance::getClass):
2665 (CInstance::invokeMethod):
2666 (CInstance::defaultValue):
2667 (CInstance::stringValue):
2668 (CInstance::numberValue):
2669 (CInstance::booleanValue):
2670 (CInstance::valueOf):
2671 * bindings/c/c_instance.h: Added.
2672 (KJS::Bindings::CInstance::getObject):
2673 * bindings/c/c_runtime.cpp: Added.
2674 (CField::valueFromInstance):
2675 (CField::setValueToInstance):
2676 * bindings/c/c_runtime.h: Added.
2677 (KJS::Bindings::CField::CField):
2678 (KJS::Bindings::CField::name):
2679 (KJS::Bindings::CField::type):
2680 (KJS::Bindings::CMethod::CMethod):
2681 (KJS::Bindings::CMethod::name):
2682 (KJS::Bindings::CMethod::numParameters):
2683 * bindings/c/c_utility.cpp: Added.
2684 (coerceValueToNPValueType):
2685 (convertValueToNPValueType):
2686 (convertNPValueTypeToValue):
2687 * bindings/c/c_utility.h: Added.
2688 * bindings/make_testbindings:
2689 * bindings/runtime.cpp:
2690 (Instance::createBindingForLanguageInstance):
2691 * bindings/runtime.h:
2692 (KJS::Bindings::Instance::):
2693 * bindings/testbindings.cpp: Added.
2694 (initializeIdentifiers):
2695 (myInterfaceHasProperty):
2696 (myInterfaceHasMethod):
2697 (myInterfaceGetProperty):
2698 (myInterfaceSetProperty):
2699 (myInterfaceInvoke):
2700 (myInterfaceAllocate):
2701 (myInterfaceInvalidate):
2702 (myInterfaceDeallocate):
2703 (GlobalImp::className):
2704 (readJavaScriptFromFile):
2707 2004-03-10 Richard Williamson <rjw@apple.com>
2709 Made changes to support new asychronous approach to calls from
2710 plugin to JavaScript
2714 * bindings/NP_jsobject.cpp:
2719 (NP_GetPropertyAtIndex):
2720 * bindings/NP_runtime.h:
2721 * bindings/make_testbindings:
2722 * bindings/runtime.cpp:
2723 (Instance::createBindingForLanguageInstance):
2725 2004-03-10 Richard Williamson <rjw@apple.com>
2727 Updated header to include proposed changes from
2728 plugin-futures list. Calls from plugin to JavaScript
2729 are now asynchronous.
2733 * bindings/NP_runtime.h:
2737 2004-03-04 Richard Williamson <rjw@apple.com>
2739 Implementation of NP_JavaScriptObject. This is the 'C' class
2740 that wraps a JavaScript object.
2744 * JavaScriptCore.pbproj/project.pbxproj:
2745 * bindings/NP_jsobject.cpp: Added.
2746 (coerceValueToNPValueType):
2747 (convertValueToNPValueType):
2748 (convertNPValueTypeToValue):
2752 (identiferFromNPIdentifier):
2757 (NP_RemoveProperty):
2759 (NP_GetPropertyAtIndex):
2760 (NP_SetPropertyAtIndex):
2761 * bindings/NP_runtime.cpp:
2763 * bindings/NP_runtime.h:
2764 * bindings/runtime_object.h:
2766 2004-03-04 Richard Williamson <rjw@apple.com>
2768 Added NP_Array implementation.
2770 Changed NP_Boolean to just depend on two static instances, no
2771 space is required for values.
2775 * bindings/NP_runtime.cpp:
2777 (NP_BoolFromBoolean):
2783 * bindings/NP_runtime.h:
2785 2004-03-03 Darin Adler <darin@apple.com>
2789 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
2790 copyright string, and that's all that was in here.
2791 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
2793 2004-03-03 Richard Williamson <rjw@apple.com>
2795 More 'C' binding implementation. Fleshed out all the
2796 'primitive' data types.
2800 * bindings/NP_runtime.cpp:
2805 (NP_CreateStringWithUTF8):
2806 (NP_CreateStringWithUTF16):
2807 (NP_UTF8FromString):
2808 (NP_UTF16FromString):
2811 (booleanDeallocate):
2813 (NP_BoolFromBoolean):
2817 (undefinedAllocate):
2818 (undefinedDeallocate):
2820 * bindings/NP_runtime.h:
2822 2004-03-03 Richard Williamson <rjw@apple.com>
2824 More 'C' binding implementation.
2828 * bindings/NP_runtime.cpp:
2831 (getIdentifierDictionary):
2832 (NP_IdentifierFromUTF8):
2833 (NP_UTF8FromIdentifier):
2838 (NP_CreateNumberWithInt):
2839 (NP_CreateNumberWithFloat):
2840 (NP_CreateNumberWithDouble):
2842 (NP_FloatFromNumber):
2843 (NP_DoubleFromNumber):
2844 * bindings/NP_runtime.h:
2846 2004-03-02 Richard Williamson <rjw@apple.com>
2848 Removed retain/release from NP_Class. Classes will not be allowed to implement their
2849 own customer retain/release scheme.
2853 * bindings/NP_runtime.cpp:
2856 * bindings/NP_runtime.h:
2858 2004-03-02 Richard Williamson <rjw@apple.com>
2860 C binding API. Partial implementation.
2862 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.
2864 Factored root object reference counting scheme. It is now useful independent
2869 * JavaScriptCore.pbproj/project.pbxproj:
2870 * bindings/NP_runtime.cpp: Added.
2871 (NP_IdentifierFromUTF8):
2872 (NP_GetIdentifiers):
2873 (NP_UTF8FromIdentifier):
2883 (NP_RemoveProperty):
2885 (NP_GetPropertyAtIndex):
2886 (NP_SetPropertyAtIndex):
2887 (NP_CreateNumberWithInt):
2888 (NP_CreateNumberWithFloat):
2889 (NP_CreateNumberWithDouble):
2891 (NP_FloatFromNumber):
2892 (NP_DoubleFromNumber):
2893 (NP_CreateStringWithUTF8):
2894 (NP_CreateStringWithUTF16):
2895 (NP_UTF8FromString):
2896 (NP_UTF16FromString):
2898 (NP_BoolFromBoolean):
2904 * bindings/NP_runtime.h: Added.
2905 * bindings/jni/jni_jsobject.cpp:
2907 (JSObject::finalize):
2908 (JSObject::createNative):
2909 (JSObject::convertValueToJObject):
2910 * bindings/jni/jni_jsobject.h:
2911 * bindings/objc/objc_jsobject.h:
2912 * bindings/objc/objc_jsobject.mm:
2914 (windowJavaScriptObject):
2915 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2916 (-[JavaScriptObject dealloc]):
2917 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
2918 (-[JavaScriptObject call:arguments:]):
2919 (-[JavaScriptObject evaluate:]):
2920 (-[JavaScriptObject getMember:]):
2921 (-[JavaScriptObject setMember:value:]):
2922 (-[JavaScriptObject removeMember:]):
2923 (-[JavaScriptObject toString]):
2924 (-[JavaScriptObject getSlot:]):
2925 (-[JavaScriptObject setSlot:value:]):
2926 * bindings/objc/objc_utility.h:
2927 * bindings/objc/objc_utility.mm:
2928 (KJS::Bindings::convertValueToObjcValue):
2929 * bindings/runtime_root.cpp: Added.
2930 (getReferencesByRootDictionary):
2931 (getReferencesDictionary):
2932 (KJS::Bindings::findReferenceDictionary):
2933 (KJS::Bindings::rootForImp):
2934 (KJS::Bindings::addNativeReference):
2935 (KJS::Bindings::removeNativeReference):
2936 (completedJavaScriptAccess):
2937 (initializeJavaScriptAccessLock):
2938 (lockJavaScriptAccess):
2939 (unlockJavaScriptAccess):
2940 (RootObject::dispatchToJavaScriptThread):
2941 (performJavaScriptAccess):
2942 (RootObject::setFindRootObjectForNativeHandleFunction):
2943 (RootObject::removeAllNativeReferences):
2944 * bindings/runtime_root.h: Added.
2945 (KJS::Bindings::RootObject::RootObject):
2946 (KJS::Bindings::RootObject::~RootObject):
2947 (KJS::Bindings::RootObject::setRootObjectImp):
2948 (KJS::Bindings::RootObject::rootObjectImp):
2949 (KJS::Bindings::RootObject::setInterpreter):
2950 (KJS::Bindings::RootObject::interpreter):
2951 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
2952 (KJS::Bindings::RootObject::runLoop):
2953 (KJS::Bindings::RootObject::performJavaScriptSource):
2959 2004-02-18 Richard Williamson <rjw@apple.com>
2961 Added NSNumber/Number conversion.
2963 Removed some unnecessary KJS:: namespace specifiers.
2967 * bindings/objc/objc_utility.mm:
2968 (KJS::Bindings::convertValueToObjcValue):
2969 (KJS::Bindings::convertObjcValueToValue):
2970 * bindings/runtime_array.h:
2972 2004-02-18 Richard Williamson <rjw@apple.com>
2974 Added support for export NSArrays.
2976 Updated valueAt() to take an ExecState so we can throw
2979 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
2980 ObjectiveC classes to control the visibility of their methods in
2985 * bindings/jni/jni_runtime.cpp:
2986 (JavaField::valueFromInstance):
2987 (JavaArray::valueAt):
2988 * bindings/jni/jni_runtime.h:
2989 * bindings/objc/objc_class.mm:
2990 (ObjcClass::methodsNamed):
2991 * bindings/objc/objc_runtime.h:
2992 (KJS::Bindings::ObjcArray::getObjcArray):
2993 * bindings/objc/objc_runtime.mm:
2994 (ObjcField::valueFromInstance):
2995 (ObjcField::setValueToInstance):
2996 (ObjcArray::ObjcArray):
2997 (ObjcArray::~ObjcArray):
2998 (ObjcArray::operator=):
2999 (ObjcArray::setValueAt):
3000 (ObjcArray::valueAt):
3001 (ObjcArray::getLength):
3002 * bindings/objc/objc_utility.mm:
3003 (KJS::Bindings::convertValueToObjcValue):
3004 (KJS::Bindings::convertObjcValueToValue):
3005 * bindings/runtime.cpp:
3006 (Instance::getValueOfField):
3007 * bindings/runtime.h:
3008 * bindings/runtime_array.cpp:
3009 (RuntimeArrayImp::get):
3010 * bindings/runtime_object.cpp:
3011 (RuntimeObjectImp::get):
3013 2004-02-17 Richard Williamson <rjw@apple.com>
3015 Added String <-> NSString conversion.
3016 Added tests of String <-> NSString conversion to test program.
3020 * bindings/objc/objc_utility.mm:
3021 (KJS::Bindings::convertValueToObjcValue):
3022 (KJS::Bindings::convertObjcValueToValue):
3024 * bindings/testbindings.mm:
3025 (-[MyFirstInterface getString]):
3027 2004-02-15 Darin Adler <darin@apple.com>
3031 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3032 and removing redundant settings of things that match defaults in other build styles.
3034 2004-02-13 Richard Williamson <rjw@apple.com>
3036 Work towards the JavaScript ObjC bindings. The bindings now work for
3037 simple scalar types. testbindings.mm is an illustration of how the
3042 * JavaScriptCore.pbproj/project.pbxproj:
3044 * bindings/jni/jni_class.cpp:
3045 (JavaClass::methodsNamed):
3046 * bindings/jni/jni_class.h:
3047 * bindings/jni/jni_instance.cpp:
3048 (JavaInstance::invokeMethod):
3049 * bindings/jni/jni_instance.h:
3050 * bindings/jni/jni_runtime.h:
3051 (KJS::Bindings::JavaMethod::returnType):
3052 * bindings/make_testbindings: Added.
3053 * bindings/objc/objc_class.h: Added.
3054 (KJS::Bindings::ObjcClass::~ObjcClass):
3055 (KJS::Bindings::ObjcClass::ObjcClass):
3056 (KJS::Bindings::ObjcClass::operator=):
3057 (KJS::Bindings::ObjcClass::constructorAt):
3058 (KJS::Bindings::ObjcClass::numConstructors):
3059 * bindings/objc/objc_class.mm: Added.
3060 (ObjcClass::_commonDelete):
3061 (ObjcClass::_commonCopy):
3062 (ObjcClass::_commonInit):
3063 (_createClassesByIsAIfNecessary):
3064 (ObjcClass::classForIsA):
3065 (ObjcClass::ObjcClass):
3067 (ObjcClass::methodsNamed):
3068 (ObjcClass::fieldNamed):
3069 * bindings/objc/objc_header.h: Added.
3070 * bindings/objc/objc_instance.h: Added.
3071 (KJS::Bindings::ObjcInstance::getObject):
3072 * bindings/objc/objc_instance.mm: Added.
3073 (ObjcInstance::ObjcInstance):
3074 (ObjcInstance::~ObjcInstance):
3075 (ObjcInstance::operator=):
3076 (ObjcInstance::begin):
3077 (ObjcInstance::end):
3078 (ObjcInstance::getClass):
3079 (ObjcInstance::invokeMethod):
3080 (ObjcInstance::defaultValue):
3081 (ObjcInstance::stringValue):
3082 (ObjcInstance::numberValue):
3083 (ObjcInstance::booleanValue):
3084 (ObjcInstance::valueOf):
3085 * bindings/objc/objc_jsobject.h: Added.
3086 * bindings/objc/objc_jsobject.mm: Added.
3087 * bindings/objc/objc_runtime.h:
3088 (KJS::Bindings::ObjcField::~ObjcField):
3089 (KJS::Bindings::ObjcField::ObjcField):
3090 (KJS::Bindings::ObjcField::operator=):
3091 (KJS::Bindings::ObjcMethod::ObjcMethod):
3092 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3093 (KJS::Bindings::ObjcMethod::operator=):
3094 * bindings/objc/objc_runtime.mm: Added.
3095 (ObjcMethod::ObjcMethod):
3097 (ObjcMethod::numParameters):
3098 (ObjcMethod::getMethodSignature):
3099 (ObjcField::ObjcField):
3102 (ObjcField::valueFromInstance):
3103 (ObjcField::setValueToInstance):
3104 * bindings/objc/objc_utility.h: Added.
3106 * bindings/objc/objc_utility.mm: Added.
3107 (KJS::Bindings::JSMethodNameToObjCMethodName):
3108 (KJS::Bindings::convertValueToObjcValue):
3109 (KJS::Bindings::convertObjcValueToValue):
3110 (KJS::Bindings::objcValueTypeForType):
3111 * bindings/runtime.cpp:
3112 (MethodList::MethodList):
3113 (MethodList::operator=):
3114 (Instance::setValueOfField):
3115 (Instance::createBindingForLanguageInstance):
3116 (Instance::createRuntimeObject):
3117 * bindings/runtime.h:
3118 * bindings/runtime_method.cpp:
3119 (RuntimeMethodImp::RuntimeMethodImp):
3120 (RuntimeMethodImp::get):
3121 (RuntimeMethodImp::call):
3122 * bindings/runtime_method.h:
3123 * bindings/runtime_object.cpp:
3124 (RuntimeObjectImp::get):
3125 (RuntimeObjectImp::hasProperty):
3126 * bindings/test.js: Added.
3127 * bindings/testbindings.mm: Added.
3128 (-[MySecondInterface init]):
3129 (-[MyFirstInterface init]):
3130 (-[MyFirstInterface dealloc]):
3131 (+[MyFirstInterface JavaScriptNameForSelector:]):
3132 (-[MyFirstInterface getInt]):
3133 (-[MyFirstInterface setInt:]):
3134 (-[MyFirstInterface getMySecondInterface]):
3135 (-[MyFirstInterface logMessage:]):
3136 (GlobalImp::className):
3137 (readJavaScriptFromFile):
3142 2004-02-08 Darin Adler <darin@apple.com>
3146 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3148 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3149 macros from working right in C++ code that uses the <cctype> header.
3152 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3153 (KJS::UTF8SequenceLengthNonASCII): Added.
3154 (KJS::inlineUTF8SequenceLength): Added.
3155 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3156 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3157 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3158 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3159 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3161 - fixed the test program so it won't hit the interpreter lock assertion
3163 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3167 2004-02-06 Richard Williamson <rjw@apple.com>
3169 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.
3173 * bindings/jni/jni_jsobject.cpp:
3174 (JSObject::toString):
3175 * bindings/jni/jni_utility.cpp:
3176 (KJS::Bindings::convertValueToJValue):
3178 2004-02-02 Darin Adler <darin@apple.com>
3182 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3184 * kjs/array_object.cpp:
3185 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3186 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3187 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3188 number is out of range. This prevents new Array(-1) from causing trouble.
3190 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3192 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3193 casting to int. Results now match those in other browsers.
3195 2004-02-02 Darin Adler <darin@apple.com>
3199 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3200 - fixed other related overflow issues
3202 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3204 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3205 must not restrict values to the range of a particular integer type.
3206 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3207 proper handling for negative results from fmod.
3208 (ValueImp::toUInt32): Ditto.
3209 (ValueImp::toUInt16): Ditto.
3210 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3212 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3213 out-of-integer-range values better in the slice function.
3214 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3215 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3216 out-of-integer-range values better in the toString function.
3217 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3218 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3219 and substr functions.
3223 2004-01-30 Richard Williamson <rjw@apple.com>
3225 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3229 * bindings/jni/jni_instance.cpp:
3230 (JavaInstance::stringValue):
3232 2004-01-26 Darin Adler <darin@apple.com>
3234 * Makefile.am: Switch from pbxbuild to xcodebuild.
3236 2004-01-22 Richard Williamson <rjw@apple.com>
3238 Added stubs for ObjC language binding to JavaScript.
3240 * JavaScriptCore.pbproj/project.pbxproj:
3241 * bindings/jni/jni_runtime.h:
3242 * bindings/objc/objc_runtime.h: Added.
3243 (KJS::Bindings::ObjcParameter::ObjcParameter):
3244 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3245 (KJS::Bindings::ObjcParameter::operator=):
3246 (KJS::Bindings::ObjcParameter::type):
3247 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3248 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3249 (KJS::Bindings::ObjcConstructor::_commonCopy):
3250 (KJS::Bindings::ObjcConstructor::operator=):
3251 (KJS::Bindings::ObjcConstructor::value):
3252 (KJS::Bindings::ObjcConstructor::parameterAt):
3253 (KJS::Bindings::ObjcConstructor::numParameters):
3254 (KJS::Bindings::ObjcField::ObjcField):
3255 (KJS::Bindings::ObjcField::~ObjcField):
3256 * bindings/runtime.h:
3258 2004-01-22 Richard Williamson <rjw@apple.com>
3260 Simplified JavaString by using UString as backing store. This
3261 revealed a bug in CString's assignment operator which I fixed.
3263 Removed some dead code.
3267 * bindings/jni/jni_runtime.h:
3268 (KJS::Bindings::JavaString::JavaString):
3269 (KJS::Bindings::JavaString::_commonInit):
3270 (KJS::Bindings::JavaString::UTF8String):
3271 (KJS::Bindings::JavaString::uchars):
3272 (KJS::Bindings::JavaString::length):
3273 (KJS::Bindings::JavaString::ustring):
3274 * bindings/runtime_object.cpp:
3275 (RuntimeObjectImp::RuntimeObjectImp):
3276 * bindings/runtime_object.h:
3278 (KJS::CString::CString):
3279 (KJS::CString::operator=):
3285 2004-01-16 Richard Williamson <rjw@apple.com>
3287 Fixed 3525853. We weren't handling mapping to overloaded Java
3288 methods very well. Even though this is undefined the other
3289 browsers support it. Also fixed a bug with returning arrays
3290 from Java functions.
3294 * bindings/jni/jni_class.cpp:
3295 (JavaClass::_commonInit):
3296 (JavaClass::methodsNamed):
3297 * bindings/jni/jni_class.h:
3298 * bindings/jni/jni_instance.cpp:
3299 (JavaInstance::invokeMethod):
3300 * bindings/jni/jni_instance.h:
3301 * bindings/jni/jni_runtime.cpp:
3302 (JavaArray::convertJObjectToArray):
3303 (JavaField::valueFromInstance):
3304 (JavaMethod::signature):
3305 (JavaArray::valueAt):
3306 * bindings/jni/jni_runtime.h:
3307 * bindings/jni_jsobject.cpp:
3309 (JSObject::convertJObjectToValue):
3310 * bindings/runtime.cpp:
3311 (MethodList::addMethod):
3312 (MethodList::length):
3313 (MethodList::methodAt):
3314 (MethodList::~MethodList):
3315 * bindings/runtime.h:
3316 (KJS::Bindings::MethodList::MethodList):
3317 * bindings/runtime_method.cpp:
3318 (RuntimeMethodImp::RuntimeMethodImp):
3319 (RuntimeMethodImp::get):
3320 (RuntimeMethodImp::call):
3321 * bindings/runtime_method.h:
3322 * bindings/runtime_object.cpp:
3323 (RuntimeObjectImp::get):
3324 (RuntimeObjectImp::hasProperty):
3326 2004-01-16 Richard Williamson <rjw@apple.com>
3328 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3329 protection implemented for 3530401.
3333 * bindings/runtime_method.cpp:
3334 (RuntimeMethodImp::call):
3336 2004-01-15 Richard Williamson <rjw@apple.com>
3338 Fixed 3530401. JNI doesn't cleanup local refs created on the
3339 main thread. IMO this is a bad bug in our JMI implementation.
3341 To work-around the problem I explicitly delete all local refs.
3342 Further, I've added Push/PopLocalFrame calls to catch any refs
3343 that I may have missed. This will guarantee that we don't leak
3344 any Java references.
3348 * bindings/jni/jni_class.cpp:
3349 (JavaClass::_commonInit):
3350 (JavaClass::JavaClass):
3351 * bindings/jni/jni_instance.cpp:
3352 (JavaInstance::begin):
3353 (JavaInstance::end):
3354 * bindings/jni/jni_instance.h:
3355 * bindings/jni/jni_runtime.cpp:
3356 (JavaConstructor::JavaConstructor):
3357 (JavaMethod::JavaMethod):
3358 * bindings/jni_jsobject.cpp:
3359 (JSObject::listFromJArray):
3360 * bindings/runtime.h:
3361 (KJS::Bindings::Instance::begin):
3362 (KJS::Bindings::Instance::end):
3363 * bindings/runtime_object.cpp:
3364 (RuntimeObjectImp::get):
3365 (RuntimeObjectImp::put):
3366 (RuntimeObjectImp::canPut):
3367 (RuntimeObjectImp::hasProperty):
3368 (RuntimeObjectImp::defaultValue):
3370 2004-01-15 Vicki Murley <vicki@apple.com>
3374 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3376 2004-01-14 Richard Williamson <rjw@apple.com>
3378 Fixed 3529466. With recent changes to Java plugin we must no
3379 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3383 * bindings/jni/jni_instance.cpp:
3384 (JObjectWrapper::JObjectWrapper):
3388 2004-01-14 Richard Williamson <rjw@apple.com>
3392 Finalize may be called on an JSObject after we've already remove all our references. The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about. The fix is to check in finalize that we're getting a call on an instance that we still care about.
3396 * bindings/jni_jsobject.cpp:
3398 (removeJavaReference):
3399 (RootObject::removeAllJavaReferencesForRoot):
3402 2004-01-13 Richard Williamson <rjw@apple.com>
3406 The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable. It is set and retained once and should not be released. Unfortunately is it being released when the 'root' object on a LiveConnect applet is released. This has the symptom of eventually causing an deallocation of the main run loop! Usually after about 5 instantiations/destructions of a LiveConnect applet. The CFRelease of the run loop was removed.
3410 * bindings/jni_jsobject.h:
3411 (KJS::Bindings::RootObject::~RootObject):
3417 2004-01-06 Richard Williamson <rjw@apple.com>
3419 Fixed 3521814. Finalize messages weren't being dispatched!
3423 * bindings/jni_jsobject.cpp:
3426 2004-01-05 Richard Williamson <rjw@apple.com>
3428 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
3429 described by 3515579.
3431 Also cleanup up logging of Java exceptions.
3435 * bindings/jni/jni_class.cpp:
3436 (JavaClass::classForInstance):
3437 * bindings/jni/jni_instance.cpp:
3438 (JavaInstance::JavaInstance):
3439 (JavaInstance::getClass):
3440 (JavaInstance::invokeMethod):
3441 (JObjectWrapper::JObjectWrapper):
3442 (JObjectWrapper::~JObjectWrapper):
3443 * bindings/jni/jni_instance.h:
3444 (KJS::Bindings::JavaInstance::operator=):
3445 * bindings/jni/jni_runtime.cpp:
3446 (JavaMethod::JavaMethod):
3447 (JavaMethod::methodID):
3448 * bindings/jni/jni_runtime.h:
3449 (KJS::Bindings::JavaMethod::JavaMethod):
3450 * bindings/jni/jni_utility.cpp:
3454 (KJS::Bindings::getMethodID):
3455 (KJS::Bindings::callJNIVoidMethodIDA):
3456 (KJS::Bindings::callJNIObjectMethodIDA):
3457 (KJS::Bindings::callJNIByteMethodIDA):
3458 (KJS::Bindings::callJNICharMethodIDA):
3459 (KJS::Bindings::callJNIShortMethodIDA):
3460 (KJS::Bindings::callJNIIntMethodIDA):
3461 (KJS::Bindings::callJNILongMethodIDA):
3462 (KJS::Bindings::callJNIFloatMethodIDA):
3463 (KJS::Bindings::callJNIDoubleMethodIDA):
3464 (KJS::Bindings::callJNIBooleanMethodIDA):
3465 (KJS::Bindings::getCharactersFromJStringInEnv):
3466 (KJS::Bindings::getUCharactersFromJStringInEnv):
3467 (KJS::Bindings::getJNIField):
3468 * bindings/jni/jni_utility.h:
3470 l2003-12-23 John Sullivan <sullivan@apple.com>
3472 * JavaScriptCore.pbproj/project.pbxproj:
3473 Xcode version wars, harmless
3475 2003-12-23 Darin Adler <darin@apple.com>
3477 Reviewed by John (concept, not code, which is just the old code coming back).
3479 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
3481 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
3482 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
3484 2003-12-19 Richard Williamson <rjw@apple.com>
3486 Fixed 3515597. When an error occurs we need
3487 to make sure result values are zeroed.
3489 Cleaned up logs by adding a newline.
3493 * bindings/jni/jni_utility.cpp:
3494 (KJS::Bindings::getJavaVM):
3495 (KJS::Bindings::getJNIEnv):
3498 (KJS::Bindings::getJNIField):
3499 * bindings/jni_jsobject.cpp:
3500 (JSObject::convertValueToJObject):
3504 2003-12-17 Richard Williamson <rjw@apple.com>
3506 Ensure that all the symbols we export are in the KJS
3507 namespace (3512245).
3509 Also renamed JavaString.characters() to JavaString.UTF8String()
3510 for enhanced clarity.
3512 Added some sanity checking to constructor of JObjectWrapper.
3517 * bindings/jni/jni_class.cpp:
3518 * bindings/jni/jni_class.h:
3519 * bindings/jni/jni_instance.cpp:
3520 (JavaInstance::invokeMethod):
3521 (JObjectWrapper::JObjectWrapper):
3522 * bindings/jni/jni_instance.h:
3523 * bindings/jni/jni_runtime.cpp:
3524 (JavaParameter::JavaParameter):
3525 (JavaField::JavaField):
3526 (JavaMethod::JavaMethod):
3527 (JavaMethod::signature):
3528 * bindings/jni/jni_runtime.h:
3529 (KJS::Bindings::JavaString::ascii):
3530 (KJS::Bindings::JavaString::UTF8String):
3531 (KJS::Bindings::JavaString::JavaString):
3532 (KJS::Bindings::JavaString::_commonInit):
3533 (KJS::Bindings::JavaString::uchars):
3534 (KJS::Bindings::JavaString::length):
3535 (KJS::Bindings::JavaString::ustring):
3536 (KJS::Bindings::JavaParameter::type):
3537 (KJS::Bindings::JavaField::name):
3538 (KJS::Bindings::JavaField::type):
3539 (KJS::Bindings::JavaMethod::name):
3540 (KJS::Bindings::JavaMethod::returnType):
3541 * bindings/jni/jni_utility.cpp:
3542 (KJS::Bindings::getJavaVM):
3543 (KJS::Bindings::getJNIEnv):
3544 (KJS::Bindings::callJNIVoidMethod):
3545 (KJS::Bindings::callJNIObjectMethod):
3546 (KJS::Bindings::callJNIBooleanMethod):
3547 (KJS::Bindings::callJNIByteMethod):
3548 (KJS::Bindings::callJNICharMethod):
3549 (KJS::Bindings::callJNIShortMethod):
3550 (KJS::Bindings::callJNIIntMethod):
3551 (KJS::Bindings::callJNILongMethod):
3552 (KJS::Bindings::callJNIFloatMethod):
3553 (KJS::Bindings::callJNIDoubleMethod):
3554 (KJS::Bindings::callJNIVoidMethodA):
3555 (KJS::Bindings::callJNIObjectMethodA):
3556 (KJS::Bindings::callJNIByteMethodA):
3557 (KJS::Bindings::callJNICharMethodA):
3558 (KJS::Bindings::callJNIShortMethodA):
3559 (KJS::Bindings::callJNIIntMethodA):
3560 (KJS::Bindings::callJNILongMethodA):
3561 (KJS::Bindings::callJNIFloatMethodA):
3562 (KJS::Bindings::callJNIDoubleMethodA):
3563 (KJS::Bindings::callJNIBooleanMethodA):
3564 (KJS::Bindings::getCharactersFromJString):
3565 (KJS::Bindings::releaseCharactersForJString):
3566 (KJS::Bindings::getCharactersFromJStringInEnv):
3567 (KJS::Bindings::releaseCharactersForJStringInEnv):
3568 (KJS::Bindings::getUCharactersFromJStringInEnv):
3569 (KJS::Bindings::releaseUCharactersForJStringInEnv):
3570 (KJS::Bindings::JNITypeFromClassName):
3571 (KJS::Bindings::signatureFromPrimitiveType):
3572 (KJS::Bindings::JNITypeFromPrimitiveType):
3573 (KJS::Bindings::getJNIField):
3574 (KJS::Bindings::convertValueToJValue):
3575 * bindings/jni/jni_utility.h: