1 2005-01-13 Vicki Murley <vicki@apple.com>
5 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
7 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
9 2005-01-12 Richard Williamson <rjw@apple.com>
11 Avoid additional work on dealloc by adding early out to
12 removeNativeReference(). (This will save time on dealloc
13 for all ObjC DOM objects.)
17 * bindings/runtime_root.cpp:
18 (KJS::Bindings::removeNativeReference):
20 2005-01-12 Richard Williamson <rjw@apple.com>
22 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
24 We were always returning the first "root" object for all runtime
25 objects. Changed 0 in loop to i, the index.
27 Reviewed by David Harrison.
29 * bindings/runtime_root.cpp:
30 (KJS::Bindings::rootForImp):
32 2005-01-11 Richard Williamson <rjw@apple.com>
34 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
36 Use the new dispatching API to invoke JNI, rather than calling JNI
39 Reviewed by David Harrison.
41 * bindings/jni/jni_instance.cpp:
42 (JavaInstance::invokeMethod):
43 * bindings/jni/jni_runtime.cpp:
44 (JavaField::dispatchValueFromInstance):
45 (JavaField::valueFromInstance):
46 (JavaField::dispatchSetValueToInstance):
47 (JavaField::setValueToInstance):
48 * bindings/jni/jni_runtime.h:
49 * bindings/jni/jni_utility.cpp:
50 (KJS::Bindings::convertValueToJValue):
58 2004-12-17 Maciej Stachowiak <mjs@apple.com>
62 <rdar://problem/3926869> Opening caches window after running PLT causes crash
64 * kjs/protected_values.cpp:
65 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
66 the protected value table.
67 (KJS::ProtectedValues::increaseProtectCount): Ditto.
68 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
70 2004-12-16 Darin Adler <darin@apple.com>
74 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
76 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
77 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
78 non-locale-specific versions.
79 * kjs/string_object.lut.h: Regenerated.
81 2004-12-14 Richard Williamson <rjw@apple.com>
83 Pass URL of plugin view when call into JNI.
87 * bindings/jni/jni_objc.mm:
88 (KJS::Bindings::dispatchJNICall):
90 2004-12-13 Richard Williamson <rjw@apple.com>
92 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
94 Add support for calling static Java methods from JavaScript.
98 * bindings/jni/jni_instance.cpp:
99 (JavaInstance::invokeMethod):
100 * bindings/jni/jni_runtime.cpp:
101 (JavaMethod::JavaMethod):
102 * bindings/jni/jni_runtime.h:
103 (KJS::Bindings::JavaMethod::isStatic):
104 * bindings/jni/jni_utility.cpp:
105 (callJNIStaticMethod):
106 (KJS::Bindings::callJNIBooleanMethod):
107 (KJS::Bindings::callJNIStaticBooleanMethod):
108 * bindings/jni/jni_utility.h:
110 2004-12-13 Richard Williamson <rjw@apple.com>
112 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
116 * bindings/jni/jni_instance.cpp:
117 (JavaInstance::invokeMethod):
118 * bindings/jni/jni_objc.mm:
119 (KJS::Bindings::dispatchJNICall):
120 * bindings/jni/jni_runtime.h:
121 * bindings/jni/jni_utility.h:
125 2004-12-07 Maciej Stachowiak <mjs@apple.com>
129 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
131 The fix was to implement copy constructor and assignment operator,
132 the ones that worked on the base class did not replace the
136 (KJS::ProtectedValue::ProtectedValue):
137 (KJS::ProtectedValue::operator=):
138 (KJS::ProtectedObject::ProtectedObject):
139 (KJS::ProtectedObject::operator=):
141 Also fixed a bug in the GC test mode that compares the results of
142 the old collector and the new collector.
149 2004-11-23 Richard Williamson <rjw@apple.com>
151 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
155 * bindings/c/c_class.cpp:
156 (CClass::_commonInit):
158 2004-11-21 Maciej Stachowiak <mjs@apple.com>
162 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
165 (KJS::Collector::Thread::Thread):
166 (KJS::destroyRegisteredThread):
167 (KJS::initializeRegisteredThreadKey):
168 (KJS::Collector::registerThread):
169 (KJS::Collector::markStackObjectsConservatively):
170 (KJS::Collector::markCurrentThreadConservatively):
171 (KJS::Collector::markOtherThreadConservatively):
179 2004-11-15 Richard Williamson <rjw@apple.com>
181 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
185 * bindings/objc/objc_instance.mm:
186 (ObjcInstance::stringValue):
187 * bindings/objc/objc_utility.h:
188 * bindings/objc/objc_utility.mm:
189 (KJS::Bindings::convertNSStringToString):
190 (KJS::Bindings::convertObjcValueToValue):
194 2004-11-09 Chris Blumenberg <cblu@apple.com>
196 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
201 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
202 * bindings/softlinking.c: Added.
204 (getFunctionPointer): new
205 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
209 2004-11-04 Darin Adler <darin@apple.com>
213 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
214 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
215 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
216 than allocating a new one
218 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
219 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
220 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
221 actually allocate only the very first time it's called.
222 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
223 shared instance since there can be only one).
224 (-[WebUndefined copyWithZone:]): Ditto.
225 (-[WebUndefined retain]): Ditto.
226 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
228 (-[WebUndefined autorelease]): Simplified to just return self (see above).
229 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
230 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
231 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
232 bug mentioned above).
233 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
234 No need to call init, since that's a no-op for this class.
236 2004-11-03 David Harrison <harrison@apple.com>
240 Eliminate the use of a marker file to determine how to build.
245 2004-11-01 Richard Williamson <rjw@apple.com>
247 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
251 * bindings/c/c_instance.cpp:
252 (CInstance::invokeMethod):
253 (CInstance::invokeDefaultMethod):
254 Initialize out parameters to void type.
256 * bindings/c/c_runtime.cpp:
257 (CField::valueFromInstance):
258 (CField::setValueToInstance):
259 Initialize out parameters to void type.
260 Also added additional checks to protect against classes that
261 don't implement all functions.
263 2004-11-01 Richard Williamson <rjw@apple.com>
265 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
270 * bindings/objc/WebScriptObject.mm:
271 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
272 Added additional conversion Undefined -> WebUndefined.
273 * bindings/objc/objc_utility.mm:
274 (KJS::Bindings::convertObjcValueToValue):
275 Added additional conversion WebUndefined -> Undefined.
277 2004-11-01 Darin Adler <darin@apple.com>
279 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
281 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
282 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
283 report to match the contents of the file.
289 2004-10-22 Ken Kocienda <kocienda@apple.com>
293 * JavaScriptCore.pbproj/project.pbxproj:
294 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
298 2004-10-13 Richard Williamson <rjw@apple.com>
300 Moved boolean checks prior to NSNumber checks. booleans are
303 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
307 * bindings/objc/objc_utility.mm:
308 (KJS::Bindings::convertObjcValueToValue):
310 2004-10-12 Richard Williamson <rjw@apple.com>
312 Fixed access to DOM object via WebScriptObject API.
313 The execution context for DOM objects wasn't being found.
314 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
318 * bindings/objc/WebScriptObject.mm:
320 (-[WebScriptObject KJS::Bindings::]):
321 (-[WebScriptObject callWebScriptMethod:withArguments:]):
322 (-[WebScriptObject evaluateWebScript:]):
323 (-[WebScriptObject setValue:forKey:]):
324 (-[WebScriptObject valueForKey:]):
325 (-[WebScriptObject stringRepresentation]):
326 * bindings/objc/WebScriptObjectPrivate.h:
328 2004-10-09 Darin Adler <darin@apple.com>
332 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
334 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
335 creating an init routine.
337 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
338 require a global constructor that creates an init routine.
340 2004-10-09 Darin Adler <darin@apple.com>
344 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
346 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
347 work with the window object of the page the function is in, not the page of the caller. This
348 is what all other browsers do. This code was hidden before by the "everything is defined on
349 window object" hack in WebCore.
351 2004-10-07 Richard Williamson <rjw@apple.com>
353 Added simple JavaScript call tracing. Very useful for
354 debugging complex pages.
356 Tracing is only available in development builds and is
359 (gdb) set traceJavaScript = 1
363 setTraceJavaScript(true)
365 Function, args, and return values are printed to console. Very
370 * kjs/function_object.cpp:
371 (FunctionProtoFuncImp::call):
377 2004-10-05 Richard Williamson <rjw@apple.com>
379 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
383 * bindings/NP_jsobject.cpp:
385 * bindings/npruntime.cpp:
386 (_NPN_SetExceptionWithUTF8):
387 * bindings/objc/WebScriptObject.mm:
388 (+[WebScriptObject throwException:]):
390 (KJS::InterpreterImp::context):
392 2004-10-05 Richard Williamson <rjw@apple.com>
394 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
398 * bindings/objc/objc_utility.mm:
399 (KJS::Bindings::convertObjcValueToValue):
401 2004-10-04 Darin Adler <darin@apple.com>
405 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
407 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
409 - rolled out an old workaround we don't need any more
411 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
412 required it is no longer there.
414 2004-09-30 Richard Williamson <rjw@apple.com>
416 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
420 * bindings/NP_jsobject.cpp:
424 * bindings/c/c_class.cpp:
425 (CClass::methodsNamed):
426 (CClass::fieldNamed):
427 * bindings/c/c_class.h:
428 * bindings/c/c_instance.cpp:
429 (CInstance::invokeMethod):
430 * bindings/jni/jni_class.cpp:
431 (JavaClass::methodsNamed):
432 * bindings/jni/jni_class.h:
433 * bindings/npruntime.h:
434 * bindings/objc/objc_class.h:
435 * bindings/objc/objc_class.mm:
436 (ObjcClass::methodsNamed):
437 * bindings/runtime.h:
438 * bindings/runtime_object.cpp:
439 (RuntimeObjectImp::get):
440 (RuntimeObjectImp::hasProperty):
442 2004-09-29 Chris Blumenberg <cblu@apple.com>
444 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.
448 * JavaScriptCore.pbproj/project.pbxproj:
449 * bindings/NP_jsobject.cpp:
450 (_NPN_CreateScriptObject):
451 (_NPN_InvokeDefault):
456 (_NPN_RemoveProperty):
459 * bindings/c/c_class.cpp:
460 (CClass::methodsNamed):
461 (CClass::fieldNamed):
462 * bindings/c/c_instance.cpp:
463 (CInstance::CInstance):
464 (CInstance::~CInstance):
465 (CInstance::operator=):
466 (CInstance::invokeMethod):
467 (CInstance::invokeDefaultMethod):
468 * bindings/c/c_runtime.cpp:
469 * bindings/c/c_runtime.h:
470 (KJS::Bindings::CField::name):
471 (KJS::Bindings::CMethod::name):
472 * bindings/npruntime.cpp:
473 (_NPN_GetStringIdentifier):
474 (_NPN_GetStringIdentifiers):
475 (_NPN_GetIntIdentifier):
476 (_NPN_IdentifierIsString):
477 (_NPN_UTF8FromIdentifier):
478 (_NPN_IntFromIdentifier):
479 (NPN_InitializeVariantWithObject):
480 (_NPN_ReleaseVariantValue):
483 (_NPN_ReleaseObject):
484 (_NPN_SetExceptionWithUTF8):
487 2004-09-26 Darin Adler <darin@apple.com>
489 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
490 low() to get Unicode value of character, and just use unicode().
492 2004-09-26 Darin Adler <darin@apple.com>
494 - refine charAt/charCodeAt fix slightly
496 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
497 omitted parameter, as we do everywhere else, and as other browsers do here.
499 2004-09-26 Darin Adler <darin@apple.com>
503 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
505 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
506 the program. We were doing this properly for functions, but not entire programs.
508 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
510 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
511 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
513 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
519 2004-09-14 Richard Williamson <rjw@apple.com>
521 1. Add class parameter to object allocation function. This is somewhat redundant, given that
522 the allocation function is in the class function vector, but people wanted to use the same
523 allocation function for different classes.
525 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
527 3. Add support for a default function on an object. This is a feature that ActiveX supports,
528 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
529 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
530 'Objective-C' bindings.
532 There bugs are covered by
534 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
535 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
536 <rdar://problem/3674754> Need to implement latest npruntime.h
540 * bindings/NP_jsobject.cpp:
544 * bindings/c/c_class.cpp:
545 * bindings/c/c_instance.cpp:
546 (CInstance::CInstance):
547 (CInstance::operator=):
548 (CInstance::invokeMethod):
549 (CInstance::invokeDefaultMethod):
550 * bindings/c/c_instance.h:
551 * bindings/c/c_runtime.cpp:
552 * bindings/c/c_runtime.h:
553 * bindings/jni/jni_instance.cpp:
554 (JavaInstance::invokeDefaultMethod):
555 * bindings/jni/jni_instance.h:
556 * bindings/npruntime.cpp:
558 * bindings/npruntime.h:
559 * bindings/objc/WebScriptObject.h:
560 * bindings/objc/objc_class.mm:
561 (ObjcClass::fallbackObject):
562 * bindings/objc/objc_instance.h:
563 * bindings/objc/objc_instance.mm:
564 (ObjcInstance::invokeDefaultMethod):
565 * bindings/objc/objc_runtime.h:
566 * bindings/objc/objc_runtime.mm:
567 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
568 (ObjcFallbackObjectImp::get):
569 (ObjcFallbackObjectImp::put):
570 (ObjcFallbackObjectImp::canPut):
571 (ObjcFallbackObjectImp::implementsCall):
572 (ObjcFallbackObjectImp::call):
573 (ObjcFallbackObjectImp::hasProperty):
574 (ObjcFallbackObjectImp::deleteProperty):
575 (ObjcFallbackObjectImp::defaultValue):
576 * bindings/runtime.h:
577 (KJS::Bindings::Class::fallbackObject):
578 (KJS::Bindings::Instance::getValueOfUndefinedField):
579 (KJS::Bindings::Instance::setValueOfUndefinedField):
580 (KJS::Bindings::Instance::valueOf):
581 * bindings/runtime_object.cpp:
582 (RuntimeObjectImp::implementsCall):
583 (RuntimeObjectImp::call):
584 * bindings/runtime_object.h:
586 2004-09-13 Maciej Stachowiak <mjs@apple.com>
590 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
592 * kjs/string_object.cpp:
593 (StringProtoFuncImp::call): Replaced implementation of replace()
594 method with function below...
595 (replace): In order to avoid excessive allocation and copying,
596 figure out the ranges of the original string and replacement
597 strings to be assembled, instead of constantly creating new
598 strings at each substitution. The old behavior is basically O(N^2)
599 for a global replace on a pattern that matches many places in the
601 (regExpIsGlobal): Helper function for the above.
602 (expandSourceRanges): ditto
603 (pushSourceRange): ditto
604 (expandReplacements): ditto
605 (pushReplacement): ditto
607 (KJS::UString::spliceSubstringsWithSeparators): New method that
608 pieces together substring ranges of this string together with
609 specified separators, all at one go.
611 (KJS::UString::Range::Range): Added new helper class to represent
614 2004-09-14 Maciej Stachowiak <mjs@apple.com>
618 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
621 (KJS::GlobalFuncImp::call): Make sure to escape null
622 characters. This is a bug in the new code that made part of the
625 2004-09-13 Darin Adler <darin@apple.com>
627 Reviewed by Kevin and Maciej.
629 - new function to support fix for DIG bug in WebCore
631 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
632 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
634 2004-09-12 Darin Adler <darin@apple.com>
636 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
637 of escape and unescape.
639 2004-09-12 Darin Adler <darin@apple.com>
643 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
645 * kjs/date_object.cpp:
646 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
647 uses CFDateFormatter.
648 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
650 2004-09-09 Maciej Stachowiak <mjs@apple.com>
654 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
657 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
658 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
660 (Lexer::isHexDigit): Made static and non-const.
665 2004-09-06 Darin Adler <darin@apple.com>
667 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
671 2004-09-01 Richard Williamson <rjw@apple.com>
673 Add pid to exception messages (to help debug dashboard clients).
677 * kjs/interpreter.cpp:
678 (Interpreter::evaluate):
682 2004-08-20 Richard Williamson <rjw@apple.com>
684 Implemented new JNI abstraction. We no longer invoke Java methods
685 directly with JNI, rather we call into the plugin. This allows the
686 plugin to dispatch the call to the appropriate VM thread. This
687 change should (will?) fix a whole class of threading related problems with
692 * JavaScriptCore.pbproj/project.pbxproj:
693 * bindings/c/c_instance.h:
694 (KJS::Bindings::CInstance::setExecutionContext):
695 (KJS::Bindings::CInstance::executionContext):
696 * bindings/jni/jni_instance.cpp:
697 (JavaInstance::JavaInstance):
698 (JavaInstance::invokeMethod):
699 (JavaInstance::setExecutionContext):
700 (JavaInstance::executionContext):
701 * bindings/jni/jni_instance.h:
702 * bindings/jni/jni_jsobject.cpp:
703 (JSObject::convertJObjectToValue):
704 * bindings/jni/jni_runtime.cpp:
705 (JavaField::JavaField):
706 (JavaArray::convertJObjectToArray):
707 (JavaField::valueFromInstance):
708 (JavaArray::JavaArray):
709 (JavaArray::valueAt):
710 * bindings/jni/jni_runtime.h:
711 (KJS::Bindings::JavaArray::operator=):
712 (KJS::Bindings::JavaArray::executionContext):
713 * bindings/jni/jni_utility.h:
714 * bindings/objc/objc_instance.h:
715 (KJS::Bindings::ObjcInstance::setExecutionContext):
716 (KJS::Bindings::ObjcInstance::executionContext):
717 * bindings/runtime.cpp:
718 (Instance::createBindingForLanguageInstance):
719 * bindings/runtime.h:
720 * bindings/runtime_root.h:
721 (KJS::Bindings::RootObject::nativeHandle):
725 2004-08-19 Vicki Murley <vicki@apple.com>
729 * kjs/property_map.cpp:
730 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
732 2004-08-17 Darin Adler <darin@apple.com>
736 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
738 * kjs/property_map.h: Added some private functions.
739 * kjs/property_map.cpp:
740 (KJS::PropertyMap::clear): Set sentinelCount to 0.
741 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
742 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
743 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
744 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
745 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
746 deleted-element sentinels.
747 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
749 2004-08-16 Maciej Stachowiak <mjs@apple.com>
751 Code change by Eric Albert, reviewd by me.
753 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
755 * kjs/date_object.cpp:
756 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
757 entirely would be even better, but is not required to fix this bug.
761 2004-08-16 Richard Williamson <rjw@apple.com>
763 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
765 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
769 * bindings/NP_jsobject.cpp:
771 * bindings/jni/jni_jsobject.cpp:
773 * bindings/objc/WebScriptObject.mm:
774 (-[WebScriptObject evaluateWebScript:]):
776 2004-08-15 Richard Williamson <rjw@apple.com>
778 More updates to np headers. Implemented new NPN functions.
782 * bindings/NP_jsobject.cpp:
786 * bindings/npruntime.h:
788 2004-08-13 Darin Adler <darin@apple.com>
790 - fix build so we can compile again
792 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
793 is good enough so that we can compile, but it's only a stopgap measure, because I think
794 Richard has a newer one he wants to check in.
796 2004-08-12 Richard Williamson <rjw@apple.com>
798 Bring npruntime.h and friends closer to compliance with
803 * JavaScriptCore.pbproj/project.pbxproj:
804 * bindings/NP_jsobject.cpp:
806 (_NPN_CreateScriptObject):
811 (NPN_RemoveProperty):
812 * bindings/NP_jsobject.h:
813 * bindings/c/c_instance.cpp:
814 (CInstance::invokeMethod):
815 * bindings/c/c_utility.cpp:
816 (convertNPVariantToValue):
817 * bindings/npruntime.cpp:
818 (NPN_IdentifierIsString):
821 (NPN_VariantIsUndefined):
823 (NPN_VariantIsInt32):
824 (NPN_VariantIsDouble):
825 (NPN_VariantIsString):
826 (NPN_VariantIsObject):
828 (NPN_VariantToString):
829 (NPN_VariantToInt32):
830 (NPN_VariantToDouble):
831 (NPN_VariantToObject):
832 (NPN_InitializeVariantAsVoid):
833 (NPN_InitializeVariantAsNull):
834 (NPN_InitializeVariantAsUndefined):
835 (NPN_InitializeVariantWithBool):
836 (NPN_InitializeVariantWithInt32):
837 (NPN_InitializeVariantWithDouble):
838 (NPN_InitializeVariantWithString):
839 (NPN_InitializeVariantWithStringCopy):
840 (NPN_InitializeVariantWithObject):
841 (NPN_InitializeVariantWithVariant):
842 (NPN_ReleaseVariantValue):
844 * bindings/npruntime.h:
846 (_NPString::_NPVariant::):
847 * bindings/npruntime_priv.h: Added.
849 2004-08-12 Darin Adler <darin@apple.com>
853 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
856 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
857 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
858 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
859 to skip leading "+" or "-".
863 2004-08-12 Darin Adler <darin@apple.com>
867 - fixed 43 Mozilla JavaScript tests
869 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
870 * kjs/date_object.cpp:
871 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
872 than constructing a number object to pass to it.
873 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
874 (KJS::parseDate): Change to return a double instead of creating the Number object here.
875 (KJS::timeClip): Implement this as specified in the language standard.
877 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
878 flags on the prototype property.
881 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
883 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
885 (KJS::parseDigit): Added. Helper function for parseInt.
886 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
887 strtoll can handle. Also matches standard more closely.
888 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
890 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
892 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
894 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
896 (Lexer::setCode): Clear error state.
897 (Lexer::lex): Set error state if the lexer encounters an error
900 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
901 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
903 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
904 Change round to round values between -0.5 and -0 to -0 instead of +0.
906 * kjs/nodes.h: Add evaluateReference function to GroupNode.
907 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
908 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
909 would change x.y into a value that can't be deleted as a side effect.
911 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
914 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
915 get rid of the fixed size limit for code.
917 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
918 returns the string without creating a new Rep, since I'm using substr in a place where it will
921 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
922 the other day that was making a couple tests fail.
923 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
924 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
925 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
926 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
927 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
929 * kjs/string_object.lut.h: Regenerated.
931 2004-08-11 Darin Adler <darin@apple.com>
933 - fixed a tiny problem with the UTF-16 PCRE check-in
935 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
936 the ctype_meta flag to get set in items that should not have it.
938 * pcre/chartables.c: Regenerated.
940 2004-08-10 Richard Williamson <rjw@apple.com>
942 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
944 The following WebScripting methods are now supported on bound
947 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
948 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
949 - (id)valueForUndefinedKey:(NSString *)key
953 * bindings/c/c_class.cpp:
954 (CClass::fieldNamed):
955 * bindings/c/c_class.h:
956 * bindings/jni/jni_class.cpp:
957 (JavaClass::fieldNamed):
958 * bindings/jni/jni_class.h:
959 * bindings/objc/objc_class.h:
960 (KJS::Bindings::ObjcClass::isa):
961 * bindings/objc/objc_class.mm:
962 (ObjcClass::methodsNamed):
963 (ObjcClass::fieldNamed):
964 (ObjcClass::fallbackObject):
965 * bindings/objc/objc_instance.h:
966 * bindings/objc/objc_instance.mm:
967 (ObjcInstance::invokeMethod):
968 (ObjcInstance::setValueOfField):
969 (ObjcInstance::setValueOfUndefinedField):
970 (ObjcInstance::getValueOfField):
971 (ObjcInstance::getValueOfUndefinedField):
972 * bindings/objc/objc_runtime.h:
973 (KJS::Bindings::ObjcField::~ObjcField):
974 (KJS::Bindings::ObjcField::ObjcField):
975 (KJS::Bindings::ObjcField::operator=):
976 (KJS::Bindings::FallbackObjectImp::classInfo):
977 * bindings/objc/objc_runtime.mm:
978 (ObjcField::ObjcField):
981 (ObjcField::valueFromInstance):
982 (ObjcField::setValueToInstance):
983 (FallbackObjectImp::FallbackObjectImp):
984 (FallbackObjectImp::get):
985 (FallbackObjectImp::put):
986 (FallbackObjectImp::canPut):
987 (FallbackObjectImp::implementsCall):
988 (FallbackObjectImp::call):
989 (FallbackObjectImp::hasProperty):
990 (FallbackObjectImp::deleteProperty):
991 (FallbackObjectImp::defaultValue):
992 * bindings/runtime.h:
993 (KJS::Bindings::Class::fallbackObject):
994 (KJS::Bindings::Instance::getValueOfUndefinedField):
995 (KJS::Bindings::Instance::setValueOfUndefinedField):
996 * bindings/runtime_object.cpp:
997 (RuntimeObjectImp::get):
998 (RuntimeObjectImp::put):
999 (RuntimeObjectImp::canPut):
1000 (RuntimeObjectImp::hasProperty):
1001 * bindings/testbindings.mm:
1002 (-[MyFirstInterface valueForUndefinedKey:]):
1003 (-[MyFirstInterface setValue:forUndefinedKey:]):
1005 2004-08-10 Darin Adler <darin@apple.com>
1009 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1011 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1012 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1013 that need to use it.
1014 * pcre/pcre.c: Add UTF-16 support to all functions.
1015 * pcre/study.c: Ditto.
1017 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1018 the mode. Changed declarations to use symbolic constants and typedefs so we size
1019 things to ichar when needed.
1021 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1022 sized to 16-bit characters instead of 8-bit.
1025 (pcre_copy_substring): Use pcre_char instead of char.
1026 (pcre_get_substring_list): Ditto.
1027 (pcre_free_substring_list): Ditto.
1028 (pcre_get_substring): Ditto.
1029 (pcre_free_substring): Ditto.
1031 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1032 of hard-coding 8-bit table sizes.
1034 * pcre/chartables.c: Regenerated.
1036 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1037 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1038 is not null. The null string still has a null pointer. This prevents us from
1039 passing a null through to the regular expression engine (which results in a null
1040 error even when the string length is 0).
1043 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1044 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1046 2004-08-09 Darin Adler <darin@apple.com>
1050 - fixed 28 Mozilla JavaScript tests
1052 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1053 checking the number of arguments for the join method.
1055 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1056 than integers, so we aren't limited to 32 bits.
1058 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1059 the implementation of the pow operation. Also simplied a case that was handling positive
1060 and negative infinity separately.
1062 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1063 putting them in a long, so that unsigned shift will work properly.
1065 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1067 * kjs/operations.cpp:
1068 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1069 sign of isinf; our isinf function returns +1 even for negative infinity.
1070 (KJS::isNegInf): And again.
1071 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1072 Our floating point already handles the various infinity cases correctly.
1074 * kjs/regexp_object.cpp:
1075 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1076 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1077 array in cases where we did not match.
1078 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1079 "global", "ignoreCase", "multiline", and "source".
1081 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1082 string into undefined rather than an empty string. For the slice method, handle an
1083 undefined parameter for the limit properly as decribed in the specification, and add
1084 the limit to one case that didn't have the limit at all. For the methods that generate
1085 HTML strings, use lowercase tags instead of uppercase.
1088 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1089 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1090 (KJS::UString::append): Fix some math that caused a buffer overflow.
1091 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1092 flag) rather than converting them all to 0.
1093 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1095 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1097 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1098 the Unicode specification in a few cases where it was wrong before.
1099 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1100 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1101 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1102 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1103 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1104 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1105 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1106 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1107 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1109 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1111 * kjs/number_object.lut.h: Regenerated.
1113 2004-08-09 Darin Adler <darin@apple.com>
1117 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1119 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1120 we get a buffer overflow.
1124 2004-08-05 Richard Williamson <rjw@apple.com>
1126 Fixed part of 3674747. The QT guys need this for feature freeze.
1128 This patch implements support for the
1130 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1132 method of objects bound to JavaScript.
1137 * bindings/objc/objc_class.mm:
1138 (ObjcClass::methodsNamed):
1139 (ObjcClass::fieldNamed):
1140 * bindings/objc/objc_instance.mm:
1141 (ObjcInstance::invokeMethod):
1142 * bindings/objc/objc_runtime.h:
1143 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1144 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1145 (KJS::Bindings::ObjcMethod::javaScriptName):
1146 * bindings/objc/objc_runtime.mm:
1147 (ObjcMethod::ObjcMethod):
1148 (ObjcMethod::getMethodSignature):
1149 (ObjcMethod::setJavaScriptName):
1150 * bindings/testbindings.mm:
1152 2004-08-04 Vicki Murley <vicki@apple.com>
1156 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1159 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1160 go to the next line and continue parsing the string (instead of failing). This matches
1161 behavior in Mac IE and Mozilla.
1163 2004-08-03 Kevin Decker <kdecker@apple.com>
1167 Rolled in changes from the latest KJS sources that support additional
1168 Number.prototype functions.
1170 Specifically this patch covers the follow parts of the ECMA 3 spec:
1171 15.7.4.5, 15.7.4.6, and 15.7.4.7
1174 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1175 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1176 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1178 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1179 list of supported identifiers (a macro).
1180 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1181 and toExponential().
1182 (NumberPrototypeImp::NumberPrototypeImp):
1183 (NumberProtoFuncImp::call):
1184 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1186 (KJS::NumberProtoFuncImp::):
1187 * tests/mozilla/expected.html: Update results.
1189 2004-08-03 Darin Adler <darin@apple.com>
1193 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1195 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1196 we are supposed to just copy the regular expression object, and do so.
1197 Also tighten up arguments check to handle case where an actual "undefined"
1198 is passed rather than just omitting an argument.
1200 * tests/mozilla/expected.html: Update results.
1202 2004-08-02 Darin Adler <darin@apple.com>
1204 * tests/mozilla/.cvsignore: Added.
1205 * tests/mozilla/expected.html: Update results.
1207 2004-08-02 Darin Adler <darin@apple.com>
1211 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1213 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1214 Append the flags here so more tests paseed.
1216 2004-08-02 Darin Adler <darin@apple.com>
1220 - fixed a couple things making 5 Mozilla regexp tests pass
1222 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1224 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1225 be used as the flags string when no parameter was passed.
1227 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1228 Added a class info object for RegExp prototype so it can return
1229 a string instead of raising an exception when converting to a string.
1231 * tests/mozilla/expected.html: Update results.
1233 2004-08-02 Darin Adler <darin@apple.com>
1237 - fix crashes in mozilla tests due to mishandling NaN
1239 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1240 calls to toInteger so that NaN will get turned into something that fits in an integer.
1241 These were the ones John already fixed, but his fix used isnan and the new fix is
1244 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1245 after a call to toInteger to handle NaN properly. Also removed separate check
1246 for undefined that's not needed.
1248 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1249 as in the above two files, but for a lot more functions. Also changed one place with
1250 an explicit check for undefined to instead just check isNaN.
1252 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1253 like me who don't keep $SYMROOTS in their $PATH.
1259 2004-07-26 Kevin Decker <kdecker@apple.com>
1261 Changes done by Darin, reviewed by Kevin.
1263 - changed testkjs to build in Xcode rather than from Makefile
1265 * .cvsignore: Removed obsolete files from this list.
1266 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1267 Changed to build target "All" rather than default target. This makes us
1268 build the testkjs test tool.
1269 * dummy.cpp: Removed.
1270 * kjs/.cvsignore: Removed obsolete files from this list, including
1271 the testkjs tool, which is now built in the symroots directory.
1272 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1273 changed this file. Also this has the nice side effect of causing the tool
1274 to be rebuilt in the new location even if there are no other changes in
1275 your tree when you check this out.
1276 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1277 without setting the execute bit on jsDriver.pl.
1279 2004-07-22 Kevin Decker <kdecker@apple.com>
1283 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1285 * kjs/function_object.cpp:
1286 (FunctionObjectImp::construct):
1287 * kjs/function_object.h:
1289 (KJS::ObjectImp::construct):
1291 (KJS::Object::construct):
1293 2004-07-21 Darin Adler <darin@apple.com>
1295 * bindings/npruntime.h: Fixed typo.
1297 2004-07-19 John Sullivan <sullivan@apple.com>
1301 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1302 vulnerability in my patch for 3714644
1304 * kjs/array_object.cpp:
1305 (ArrayProtoFuncImp::call):
1306 handle NAN parameters passed to slice() by clamping to 0 and length.
1308 2004-07-19 Richard Williamson <rjw@apple.com>
1310 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1315 * bindings/jni/jni_jsobject.cpp:
1317 (JSObject::JSObject):
1319 2004-07-16 John Sullivan <sullivan@apple.com>
1323 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1324 hangs browser with javascript
1326 * kjs/array_object.cpp:
1327 (ArrayProtoFuncImp::call):
1328 Check for undefined type for args[0] the same way we were already checking
1329 for args[1]. In this case, args was zero-length, but we were treating
1330 args[0] like an integer anyway. Resulted in some code looping from a NAN
1331 value to 4, taking approximately forever.
1333 * JavaScriptCore.pbproj/project.pbxproj:
1338 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1342 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1343 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1345 * kjs/number_object.cpp:
1346 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1348 2004-07-13 Kevin Decker <kdecker@apple.com>
1350 Reviewed by kocienda.
1352 - made testkjs and JavaScriptCore a subtarget of 'All'
1353 - testkjs now builds in $SYMROOTS
1355 * JavaScriptCore.pbproj/project.pbxproj:
1359 2004-06-24 Chris Blumenberg <cblu@apple.com>
1361 Ignore .mode1 files in JavaScriptCore.pbproj
1363 Reviewed by kocienda.
1365 * JavaScriptCore.pbproj/.cvsignore:
1367 2004-06-23 Richard Williamson <rjw@apple.com>
1369 Implemented changes for latest npruntime.h.
1373 * JavaScriptCore.pbproj/project.pbxproj:
1374 * bindings/NP_jsobject.cpp:
1375 (listFromVariantArgs):
1376 (identiferFromNPIdentifier):
1377 (_NPN_CreateScriptObject):
1382 (NPN_RemoveProperty):
1383 * bindings/NP_jsobject.h:
1384 * bindings/c/c_class.cpp:
1385 (CClass::methodsNamed):
1386 (CClass::fieldNamed):
1387 * bindings/c/c_instance.cpp:
1388 (CInstance::invokeMethod):
1389 * bindings/c/c_utility.cpp:
1390 (convertNPVariantToValue):
1391 * bindings/c/c_utility.h:
1392 * bindings/npruntime.cpp:
1393 (stringIdentifierEqual):
1394 (stringIdentifierHash):
1395 (getStringIdentifierDictionary):
1396 (intIdentifierEqual):
1397 (intIdentifierHash):
1398 (getIntIdentifierDictionary):
1399 (NPN_GetStringIdentifier):
1400 (NPN_GetStringIdentifiers):
1401 (NPN_GetIntIdentifier):
1402 (NPN_IdentifierIsString):
1403 (NPN_UTF8FromIdentifier):
1404 (NPN_VariantToInt32):
1405 (NPN_VariantToDouble):
1407 * bindings/npruntime.h:
1408 * bindings/objc/WebScriptObject.mm:
1409 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1410 * bindings/runtime_object.cpp:
1411 (RuntimeObjectImp::~RuntimeObjectImp):
1412 * bindings/runtime_root.cpp:
1413 (KJS::Bindings::rootForInterpreter):
1414 * bindings/testbindings.cpp:
1415 (initializeIdentifiers):
1421 === JavaScriptCore-146.1 ===
1423 2004-06-16 Richard Williamson <rjw@apple.com>
1425 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1427 This turned out to be a show stopper for Dashboard. Accessing a nil
1428 ObjC property from JS caused a crash. Similar to the problem
1429 3696112 fixed below.
1433 * bindings/objc/objc_runtime.mm:
1434 (KJS::Bindings::ObjcField::valueFromInstance):
1438 2004-06-16 Richard Williamson <rjw@apple.com>
1440 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1442 This turned out to be a show stopper for Dashboard. We now
1443 return Undefined() when nil is returned from a ObjC method
1444 that returns an object type.
1448 * bindings/objc/objc_utility.mm:
1449 (KJS::Bindings::convertObjcValueToValue):
1453 2004-06-15 Richard Williamson <rjw@apple.com>
1455 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1457 No longer need to check respondsToSelector: for
1458 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1459 because these now have a default implementation on NSObject.
1463 * bindings/objc/objc_class.mm:
1464 (ObjcClass::methodsNamed):
1465 (ObjcClass::fieldNamed):
1467 2004-06-14 Darin Adler <darin@apple.com>
1471 - fixed some things for GC that Patrick missed, or that happened after the branch
1473 * bindings/objc/WebScriptObject.mm:
1474 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1475 (-[WebScriptObject finalize]): Added.
1477 - added some missing nil checks
1479 * bindings/objc/objc_instance.mm:
1480 (ObjcInstance::ObjcInstance): Check for nil.
1481 (ObjcInstance::~ObjcInstance): Check for nil.
1482 (ObjcInstance::operator=): Check for nil.
1484 2004-06-14 Darin Adler <darin@apple.com>
1486 Reviewed by me, code changes by Patrick Beard.
1488 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1490 * bindings/objc/objc_instance.mm:
1491 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1492 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1493 (ObjcInstance::operator=): More of the same.
1494 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1496 * bindings/objc/objc_runtime.mm:
1497 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1498 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1499 (ObjcArray::operator=): More of the same.
1501 * bindings/testbindings.mm: Fixed incorrect license.
1502 (main): Use [pool drain] if compiling on Tiger.
1506 2004-06-10 Kevin Decker <kdecker@apple.com>
1512 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1514 (KJS::Lexer::lineNo):
1515 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1517 === JavaScriptCore-143.2 ===
1519 2004-06-07 Darin Adler <darin@apple.com>
1521 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1523 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1524 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1526 === JavaScriptCore-143.1 ===
1528 2004-06-04 Kevin Decker <kdecker@apple.com>
1532 - fixed <rdar://problem/3680594>
1535 (KJS::Error::create):
1539 2004-06-04 Darin Adler <darin@apple.com>
1541 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1543 2004-06-04 Kevin Decker <kdecker@apple.com>
1547 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1548 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1549 - changed the wording of an error message
1550 - the lexer, parser, and interpreter have been made "sourceURL aware"
1551 - stored the url into Error
1553 * bindings/NP_jsobject.cpp:
1555 * bindings/jni/jni_jsobject.cpp:
1557 * bindings/objc/WebScriptObject.mm:
1558 (-[WebScriptObject evaluateWebScript:]):
1560 (GlobalFuncImp::call):
1561 * kjs/function_object.cpp:
1562 (FunctionObjectImp::construct):
1565 (InterpreterImp::checkSyntax):
1566 (InterpreterImp::evaluate):
1568 * kjs/interpreter.cpp:
1569 (Interpreter::evaluate):
1570 * kjs/interpreter.h:
1574 (KJS::Lexer::sourceURL):
1578 (FunctionCallNode::evaluate):
1581 (KJS::Error::create):
1584 2004-06-04 Richard Williamson <rjw@apple.com>
1586 Fixed crash when attempting to access properties on nil
1591 * bindings/objc/objc_instance.mm:
1592 (ObjcInstance::getClass):
1593 * bindings/runtime_object.cpp:
1594 (RuntimeObjectImp::get):
1595 * bindings/testM.js:
1596 * bindings/testbindings.mm:
1597 (-[MyFirstInterface getString]):
1599 2004-05-27 Kevin Decker <kdecker@apple.com>
1603 -revised generated error message content
1605 * kjs/error_object.cpp:
1606 (ErrorProtoFuncImp::call):
1610 (KJS::Error::create):
1614 2004-05-27 Richard Williamson <rjw@apple.com>
1616 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
1620 * bindings/objc/WebScriptObject.h:
1622 2004-05-27 Darin Adler <darin@apple.com>
1626 - moved to new symlink technique for embedding frameworks
1628 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
1629 because we don't need it any more.
1631 2004-05-24 Richard Williamson <rjw@apple.com>
1633 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
1634 fixed ClassInfo to correctly reflect inheritance. This is required
1635 because of the runtime checks in JSC for arrays, i.e. in
1636 the Function objects apply method.
1640 * bindings/jni/jni_runtime.cpp:
1641 (JavaArray::convertJObjectToArray):
1642 * bindings/objc/objc_utility.mm:
1643 (KJS::Bindings::convertObjcValueToValue):
1644 * bindings/runtime_array.cpp:
1645 (RuntimeArrayImp::RuntimeArrayImp):
1646 * bindings/runtime_array.h:
1647 * bindings/testM.js: Added.
1648 * bindings/testbindings.mm:
1649 (+[MyFirstInterface webScriptNameForSelector:]):
1650 (-[MyFirstInterface logMessages:]):
1651 (-[MyFirstInterface logMessage:prefix:]):
1652 (-[MyFirstInterface callJSObject::]):
1654 2004-05-22 Darin Adler <darin@apple.com>
1658 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
1660 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
1661 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
1662 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
1663 it hasn't been set explicitly.
1667 2004-05-20 Richard Williamson <rjw@apple.com>
1669 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
1670 can now be referenced like any other WebScriptObject, meaning
1671 you can do JS operations on them.
1673 All added implementation of finalizeForWebScript.
1677 * bindings/objc/WebScriptObject.h:
1678 * bindings/objc/WebScriptObject.mm:
1679 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
1680 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1681 (-[WebScriptObject KJS::]):
1682 (-[WebScriptObject dealloc]):
1683 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1684 (-[WebScriptObject evaluateWebScript:]):
1685 (-[WebScriptObject setValue:forKey:]):
1686 (-[WebScriptObject valueForKey:]):
1687 (-[WebScriptObject stringRepresentation]):
1688 * bindings/objc/WebScriptObjectPrivate.h:
1689 * bindings/objc/objc_instance.mm:
1690 (ObjcInstance::~ObjcInstance):
1692 2004-05-19 Richard Williamson <rjw@apple.com>
1694 Removed extraneous tabs that were added (by XCode?).
1696 * bindings/objc/WebScriptObject.h:
1698 2004-05-19 Darin Adler <darin@apple.com>
1700 - fixed headers with licenses mangled by Xcode auto-indenting
1702 * bindings/jni/jni_jsobject.cpp:
1703 * bindings/jni/jni_jsobject.h:
1704 * bindings/runtime_array.h:
1705 * bindings/runtime_root.cpp:
1706 * bindings/runtime_root.h:
1708 2004-05-18 Richard Williamson <rjw@apple.com>
1710 Added exception logging. Also check for exception and
1711 set results as appropriate.
1713 Reviewed by Maciej (partially reviewed).
1715 * bindings/objc/WebScriptObject.mm:
1716 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1717 (-[WebScriptObject evaluateWebScript:]):
1718 (-[WebScriptObject setValue:forKey:]):
1719 (-[WebScriptObject valueForKey:]):
1721 2004-05-18 Richard Williamson <rjw@apple.com>
1723 Finsished implementing support for windowScriptObject.
1724 Had to make WebScriptObjectPrivate.h accessible from
1729 * JavaScriptCore.pbproj/project.pbxproj:
1730 * bindings/objc/WebScriptObjectPrivate.h:
1732 2004-05-18 Richard Williamson <rjw@apple.com>
1734 Use KVC to set/get values instead of directly accessing
1739 * bindings/objc/WebScriptObject.mm:
1740 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1741 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1742 * bindings/objc/objc_runtime.mm:
1743 (ObjcField::valueFromInstance):
1744 (convertValueToObjcObject):
1745 (ObjcField::setValueToInstance):
1747 2004-05-17 Richard Williamson <rjw@apple.com>
1749 Implemented new API for WebScriptObject.
1751 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
1752 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
1756 * JavaScriptCore.pbproj/project.pbxproj:
1757 * bindings/c/c_instance.cpp:
1758 (CInstance::invokeMethod):
1759 * bindings/jni/jni_instance.cpp:
1760 (JavaInstance::invokeMethod):
1761 * bindings/jni/jni_jsobject.cpp:
1762 (JSObject::convertValueToJObject):
1763 * bindings/jni/jni_utility.cpp:
1764 (KJS::Bindings::getJNIField):
1765 * bindings/objc/WebScriptObject.mm:
1767 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1768 (-[WebScriptObject KJS::]):
1769 (-[WebScriptObject dealloc]):
1770 (+[WebScriptObject throwException:]):
1772 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1773 (-[WebScriptObject evaluateWebScript:]):
1774 (-[WebScriptObject setValue:forKey:]):
1775 (-[WebScriptObject valueForKey:]):
1776 (-[WebScriptObject stringRepresentation]):
1777 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1778 (+[WebUndefined undefined]):
1779 (-[WebUndefined initWithCoder:]):
1780 (-[WebUndefined encodeWithCoder:]):
1781 (-[WebUndefined copyWithZone:]):
1782 (-[WebUndefined retain]):
1783 (-[WebUndefined release]):
1784 (-[WebUndefined retainCount]):
1785 (-[WebUndefined autorelease]):
1786 (-[WebUndefined dealloc]):
1787 (-[WebUndefined copy]):
1788 (-[WebUndefined replacementObjectForPortCoder:]):
1789 * bindings/objc/WebScriptObjectPrivate.h: Added.
1790 * bindings/objc/objc_class.mm:
1791 (ObjcClass::methodsNamed):
1792 (ObjcClass::fieldNamed):
1793 * bindings/objc/objc_instance.mm:
1794 (ObjcInstance::invokeMethod):
1795 * bindings/objc/objc_jsobject.h:
1796 * bindings/objc/objc_jsobject.mm:
1797 * bindings/objc/objc_runtime.mm:
1798 (ObjcField::valueFromInstance):
1799 * bindings/objc/objc_utility.mm:
1800 (KJS::Bindings::JSMethodNameToObjCMethodName):
1801 (KJS::Bindings::convertValueToObjcValue):
1802 (KJS::Bindings::convertObjcValueToValue):
1803 * bindings/runtime.cpp:
1804 (Instance::setDidExecuteFunction):
1805 (Instance::didExecuteFunction):
1806 (Instance::setValueOfField):
1807 * bindings/runtime.h:
1808 * bindings/testbindings.mm:
1809 (+[MyFirstInterface webScriptNameForSelector:]):
1810 (-[MyFirstInterface callJSObject::]):
1812 2004-05-14 Vicki Murley <vicki@apple.com>
1816 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
1818 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
1822 2004-05-13 Richard Williamson <rjw@apple.com>
1829 * bindings/objc/WebScriptObject.h:
1831 2004-05-13 Richard Williamson <rjw@apple.com>
1833 Approved API changes. Currently unimplemented.
1838 * JavaScriptCore.pbproj/project.pbxproj:
1839 * bindings/objc/WebScriptObject.h: Added.
1840 * bindings/objc/WebScriptObject.mm: Added.
1841 (+[WebScriptObject throwException:]):
1842 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1843 (-[WebScriptObject evaluateWebScript:]):
1844 (-[WebScriptObject stringRepresentation]):
1845 (+[WebUndefined undefined]):
1846 (-[WebUndefined initWithCoder:]):
1847 (-[WebUndefined encodeWithCoder:]):
1848 (-[WebUndefined copyWithZone:]):
1850 2004-05-07 Vicki Murley <vicki@apple.com>
1854 Turn off GC since it uses ppc only instructions (which breaks
1857 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
1861 2004-05-07 Maciej Stachowiak <mjs@apple.com>
1865 - add -funroll-loops=16 compiler option for approx .5% speedup on
1866 HTML iBench and .5-1% speedup on JS iBench.
1868 * JavaScriptCore.pbproj/project.pbxproj:
1870 2004-04-25 Maciej Stachowiak <mjs@apple.com>
1874 Enable full conservative GC mode in addition to test mode. When
1875 conservative GC is enabled, we now get an 11% speed improvement on
1876 the iBench. Also fix some spots I missed before.
1878 Specific noteworth changes:
1880 * kjs/collector.cpp:
1881 (KJS::Collector::markStackObjectsConservatively): Check possible
1882 cell pointers for 8-byte aligment and verify they are not 0.
1884 * kjs/protected_values.cpp:
1885 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
1886 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
1888 (KJS::gcProtectNullTolerant): ...to here...
1889 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
1890 tolerance, and doing the check is expensive.
1892 * kjs/protected_values.cpp:
1893 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
1894 that is still very good.
1899 (KJS::ProtectedValue::ProtectedValue):
1900 (KJS::ProtectedValue::~ProtectedValue):
1901 (KJS::ProtectedValue::operator=):
1902 (KJS::ProtectedObject::ProtectedObject):
1903 (KJS::ProtectedObject::~ProtectedObject):
1904 (KJS::ProtectedObject::operator=):
1905 (KJS::ProtectedReference::ProtectedReference):
1906 (KJS::ProtectedReference::~ProtectedReference):
1907 (KJS::ProtectedReference::operator=):
1908 * kjs/protected_values.cpp:
1909 (KJS::ProtectedValues::getProtectCount):
1910 (KJS::ProtectedValues::increaseProtectCount):
1911 (KJS::ProtectedValues::decreaseProtectCount):
1912 (KJS::ProtectedValues::computeHash):
1913 * bindings/runtime_root.cpp:
1914 (KJS::Bindings::addNativeReference):
1915 (KJS::Bindings::removeNativeReference):
1916 (RootObject::removeAllNativeReferences):
1917 * bindings/runtime_root.h:
1918 (KJS::Bindings::RootObject::~RootObject):
1919 (KJS::Bindings::RootObject::setRootObjectImp):
1920 * kjs/collector.cpp:
1921 (KJS::Collector::allocate):
1922 (KJS::Collector::collect):
1925 (NumberImp::create):
1926 (InterpreterImp::globalInit):
1927 (InterpreterImp::globalClear):
1928 (InterpreterImp::mark):
1930 (KJS::List::derefValues):
1931 (KJS::List::refValues):
1932 (KJS::List::append):
1934 (KJS::ObjectImp::setInternalValue):
1935 (KJS::ObjectImp::putDirect):
1940 (KJS::ValueImp::ValueImp):
1941 (KJS::ValueImp::~ValueImp):
1943 (KJS::Value::Value):
1944 (KJS::Value::~Value):
1945 (KJS::Value::operator=):
1947 2004-04-30 Richard Williamson <rjw@apple.com>
1949 Asking an NSInvocation for it's return value when return type
1950 is void throws an exception. Added check for void return types
1951 to avoid this exception.
1955 * bindings/objc/objc_instance.mm:
1956 (ObjcInstance::invokeMethod):
1958 2004-04-29 Richard Williamson <rjw@apple.com>
1960 Fixed several bad problems with the ObjC bindings. In particular, conversion
1961 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
1965 * bindings/objc/objc_jsobject.h:
1966 * bindings/objc/objc_jsobject.mm:
1967 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
1968 (-[JavaScriptObject KJS::]):
1969 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1970 (-[JavaScriptObject call:arguments:]):
1971 (-[JavaScriptObject evaluate:]):
1972 (-[JavaScriptObject getMember:]):
1973 (-[JavaScriptObject getSlot:]):
1974 * bindings/objc/objc_runtime.mm:
1975 (ObjcField::valueFromInstance):
1976 (ObjcField::setValueToInstance):
1977 * bindings/objc/objc_utility.mm:
1978 (KJS::Bindings::convertValueToObjcValue):
1979 (KJS::Bindings::convertObjcValueToValue):
1980 * bindings/runtime.h:
1981 * bindings/runtime_root.cpp:
1982 (KJS::Bindings::rootForInterpreter):
1983 (KJS::Bindings::addNativeReference):
1984 (KJS::Bindings::removeNativeReference):
1985 * bindings/runtime_root.h:
1986 * bindings/testbindings.mm:
1987 (-[MyFirstInterface logMessage:]):
1988 (-[MyFirstInterface setJSObject:]):
1989 (-[MyFirstInterface callJSObject::]):
1991 2004-04-24 Darin Adler <darin@apple.com>
1995 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
1998 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2002 Implementation of conservative GC, based partly on code from
2003 Darin. It's turned off for now, so it shouldn't have any effect on
2006 * JavaScriptCore.pbproj/project.pbxproj:
2007 * kjs/collector.cpp:
2008 (KJS::Collector::markStackObjectsConservatively):
2009 (KJS::Collector::markProtectedObjects):
2010 (KJS::Collector::collect):
2015 * kjs/protected_values.cpp: Added.
2016 (KJS::ProtectedValues::getProtectCount):
2017 (KJS::ProtectedValues::increaseProtectCount):
2018 (KJS::ProtectedValues::insert):
2019 (KJS::ProtectedValues::decreaseProtectCount):
2020 (KJS::ProtectedValues::expand):
2021 (KJS::ProtectedValues::shrink):
2022 (KJS::ProtectedValues::rehash):
2023 (KJS::ProtectedValues::computeHash):
2024 * kjs/protected_values.h: Added.
2026 (ValueImp::useConservativeMark):
2034 2004-04-22 Richard Williamson <rjw@apple.com>
2036 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2039 * bindings/npruntime.h:
2041 2004-04-22 Richard Williamson <rjw@apple.com>
2043 Updated plugin binding API to reflect latest revision from
2046 Biggest change is the introduction of NPVariant used to represent
2047 value types. NPVariant replaces the use of NPObject for the
2048 exchange of values between scripting environment and native code.
2052 * JavaScriptCore.pbproj/project.pbxproj:
2053 * bindings/NP_jsobject.cpp:
2054 (identiferFromNPIdentifier):
2060 (NPN_GetPropertyAtIndex):
2061 (NPN_SetPropertyAtIndex):
2062 * bindings/c/c_class.cpp:
2063 (CClass::methodsNamed):
2064 (CClass::fieldNamed):
2065 * bindings/c/c_instance.cpp:
2066 (CInstance::invokeMethod):
2067 (CInstance::defaultValue):
2068 * bindings/c/c_runtime.cpp:
2069 (CField::valueFromInstance):
2070 (CField::setValueToInstance):
2071 * bindings/c/c_utility.cpp:
2072 (convertNPStringToUTF16):
2073 (convertUTF8ToUTF16):
2074 (coerceValueToNPVariantStringType):
2075 (convertValueToNPVariant):
2076 (convertNPVariantToValue):
2077 * bindings/c/c_utility.h:
2078 * bindings/npruntime.cpp:
2079 (NPN_GetIdentifier):
2080 (NPN_GetIdentifiers):
2081 (NPN_UTF8FromIdentifier):
2082 (NPN_VariantIsVoid):
2083 (NPN_VariantIsNull):
2084 (NPN_VariantIsUndefined):
2085 (NPN_VariantIsBool):
2086 (NPN_VariantIsInt32):
2087 (NPN_VariantIsDouble):
2088 (NPN_VariantIsString):
2089 (NPN_VariantIsObject):
2090 (NPN_VariantToBool):
2091 (NPN_VariantToString):
2092 (NPN_VariantToInt32):
2093 (NPN_VariantToDouble):
2094 (NPN_VariantToObject):
2095 (NPN_InitializeVariantAsVoid):
2096 (NPN_InitializeVariantAsNull):
2097 (NPN_InitializeVariantAsUndefined):
2098 (NPN_InitializeVariantWithBool):
2099 (NPN_InitializeVariantWithInt32):
2100 (NPN_InitializeVariantWithDouble):
2101 (NPN_InitializeVariantWithString):
2102 (NPN_InitializeVariantWithStringCopy):
2103 (NPN_InitializeVariantWithObject):
2104 (NPN_InitializeVariantWithVariant):
2105 (NPN_ReleaseVariantValue):
2108 (NPN_ReleaseObject):
2109 (NPN_IsKindOfClass):
2110 (NPN_SetExceptionWithUTF8):
2112 * bindings/npruntime.h:
2114 (_NPString::_NPVariant::):
2115 * bindings/testbindings.cpp:
2130 2004-04-22 Darin Adler <darin@apple.com>
2134 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2137 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2138 Was resulting in a buffer 2x the needed size.
2139 (KJS::UString::expandPreCapacity): Ditto.
2140 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2142 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2146 Preliminary change for conservative GC. Create "protected"
2147 subclasses to GC-protect objects when on heap, since we will soon
2148 remove the built-in refcounting of the normal wrapper classes. Use
2151 * JavaScriptCore.pbproj/project.pbxproj:
2154 (KJS::InterpreterImp::globalObject):
2155 * kjs/interpreter.h:
2156 * kjs/property_map.cpp:
2158 * kjs/reference_list.cpp:
2160 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2164 Optimize prepend using the shared substring optimization. Also,
2165 limit the applicability of shared append and shared prepend. If
2166 you overdo it, it does more harm than good, because you create a
2167 bunch of strings that are disqualified from future shared
2168 append/prepend, for not much immediate savings in allocate/copy
2173 (KJS::UString::Rep::create):
2174 (KJS::UString::expandedSize):
2175 (KJS::UString::usedPreCapacity):
2176 (KJS::UString::expandCapacity):
2177 (KJS::UString::expandPreCapacity):
2178 (KJS::UString::UString):
2179 (KJS::UString::append):
2180 (KJS::UString::operator=):
2182 (KJS::UString::Rep::data):
2184 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2185 Reviewed by Richard.
2187 No more need for Completion or Reference to privately inherit from
2188 Value, none of the superclass functionality is used.
2195 2004-04-16 Richard Williamson <rjw@apple.com>
2197 Added interpreter lock protection around object creation.
2201 * bindings/runtime.cpp:
2202 (Instance::createRuntimeObject):
2204 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2208 Another JavaScript speed improvement: use the mechanism from
2209 string append optimization to make taking a substring fast, again
2212 A further 22% improvement on the 24fun string speed test.
2216 (KJS::UString::Rep::create):
2217 (KJS::UString::UString):
2218 (KJS::UString::append):
2219 (KJS::UString::operator=):
2220 (KJS::UString::substr):
2222 (KJS::UString::Rep::data):
2224 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2228 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2229 - fixed <rdar://problem/3600691>: Table generation test is really slow
2230 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2232 80% speedup on the string test, lesser speedups on the other two.
2234 Two different optimizations here:
2236 1) Avoid large overhead of scanning strings to see if they are all
2237 ASCII before numeric conversion.
2240 (AssignNode::evaluate): Don't convert to integer until we know for
2241 sure the operation will need it. Attempting to convert strings to
2242 numbers is a waste when they are being appended with +=.
2244 2) Avoid huge cost of appending strings.
2246 This is done by allowing multiple strings to share a buffer but
2247 actually use different ranges of it. The first time a string is
2248 appended to, we start leaving at least 10% extra space in the
2249 buffer, so doing N appends to the same string takes O(log N)
2250 mallocs instead of O(N).
2252 * kjs/identifier.cpp:
2253 (KJS::Identifier::equal):
2254 (KJS::Identifier::add):
2257 (KJS::UCharReference::operator=):
2258 (KJS::UCharReference::ref):
2259 (KJS::UString::Rep::create):
2260 (KJS::UString::Rep::destroy):
2261 (KJS::UString::expandedSize):
2262 (KJS::UString::usedCapacity):
2263 (KJS::UString::expandCapacity):
2264 (KJS::UString::UString):
2265 (KJS::UString::null):
2266 (KJS::UString::append):
2267 (KJS::UString::operator=):
2268 (KJS::UString::toStrictUInt32):
2269 (KJS::UString::detach):
2270 (KJS::KJS::operator==):
2272 (KJS::UString::Rep::data):
2273 (KJS::UString::Rep::hash):
2275 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2279 - fix deployment build by avoiding deployment-only warning.
2281 * kjs/scope_chain.cpp:
2282 (KJS::ScopeChain::bottom):
2284 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2288 Changed things so that newly created objects get a prototype based
2289 on the scope chain of the current function, rather than the
2290 interpreter that started execution. This fixes the following bugs:
2292 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2293 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2295 * JavaScriptCore.pbproj/project.pbxproj:
2296 * kjs/array_object.cpp:
2297 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2298 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2299 (ArrayProtoFuncImp::call):
2300 (ArrayObjectImp::construct):
2301 * kjs/bool_object.cpp:
2302 (BooleanObjectImp::construct):
2303 * kjs/date_object.cpp:
2304 (DateProtoFuncImp::DateProtoFuncImp):
2305 (DateProtoFuncImp::call):
2306 (DateObjectImp::construct):
2307 * kjs/error_object.cpp:
2308 (ErrorObjectImp::construct):
2310 (FunctionImp::FunctionImp):
2311 (FunctionImp::call):
2312 (DeclaredFunctionImp::construct):
2313 (ArgumentsImp::ArgumentsImp):
2314 (GlobalFuncImp::call):
2315 * kjs/function_object.cpp:
2316 (FunctionProtoFuncImp::call):
2317 (FunctionObjectImp::construct):
2319 (BooleanImp::toObject):
2320 (StringImp::toObject):
2321 (NumberImp::toObject):
2322 (InterpreterImp::InterpreterImp):
2323 (InterpreterImp::clear):
2324 (InterpreterImp::interpreterWithGlobalObject):
2326 * kjs/interpreter.cpp:
2327 (ExecState::lexicalInterpreter):
2328 * kjs/interpreter.h:
2329 (KJS::ExecState::dynamicInterpreter):
2330 (KJS::ExecState::interpreter):
2331 * kjs/math_object.cpp:
2332 (MathFuncImp::MathFuncImp):
2334 (StatementNode::hitStatement):
2335 (StatementNode::abortStatement):
2336 (RegExpNode::evaluate):
2337 (ElementNode::evaluate):
2338 (ArrayNode::evaluate):
2339 (ObjectLiteralNode::evaluate):
2340 (PropertyValueNode::evaluate):
2341 (FunctionCallNode::evaluate):
2342 (FuncDeclNode::processFuncDecl):
2343 (FuncExprNode::evaluate):
2344 * kjs/number_object.cpp:
2345 (NumberObjectImp::construct):
2347 (KJS::ObjectImp::defaultValue):
2348 (KJS::Error::create):
2349 * kjs/object_object.cpp:
2350 (ObjectObjectImp::construct):
2351 * kjs/reference.cpp:
2352 (Reference::putValue):
2353 * kjs/regexp_object.cpp:
2354 (RegExpProtoFuncImp::call):
2355 (RegExpObjectImp::arrayOfMatches):
2356 (RegExpObjectImp::construct):
2357 * kjs/scope_chain.cpp:
2358 (KJS::ScopeChain::bottom):
2359 * kjs/scope_chain.h:
2360 * kjs/string_object.cpp:
2361 (StringProtoFuncImp::StringProtoFuncImp):
2362 (StringProtoFuncImp::call):
2363 (StringObjectImp::construct):
2369 2004-03-31 Richard Williamson <rjw@apple.com>
2371 Tedious renames based on feedback from plugin-futures list.
2372 NP_ functions are renamed with NPN_ prefix.
2373 Types prefix renamed from NP_ to NP.
2374 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2376 No review because this was just a renaming patch.
2378 * bindings/NP_jsobject.cpp:
2381 (identiferFromNPIdentifier):
2386 (NPN_RemoveProperty):
2388 (NPN_GetPropertyAtIndex):
2389 (NPN_SetPropertyAtIndex):
2390 * bindings/NP_jsobject.h:
2391 * bindings/c/c_class.cpp:
2392 (CClass::_commonInit):
2393 (CClass::classForIsA):
2395 (CClass::methodsNamed):
2396 (CClass::fieldNamed):
2397 * bindings/c/c_class.h:
2398 * bindings/c/c_instance.cpp:
2399 (CInstance::CInstance):
2400 (CInstance::~CInstance):
2401 (CInstance::operator=):
2402 (CInstance::invokeMethod):
2403 (CInstance::defaultValue):
2404 * bindings/c/c_instance.h:
2405 (KJS::Bindings::CInstance::getObject):
2406 * bindings/c/c_runtime.cpp:
2407 (CField::valueFromInstance):
2408 (CField::setValueToInstance):
2409 * bindings/c/c_runtime.h:
2410 (KJS::Bindings::CField::CField):
2411 (KJS::Bindings::CField::name):
2412 (KJS::Bindings::CMethod::CMethod):
2413 (KJS::Bindings::CMethod::name):
2414 * bindings/c/c_utility.cpp:
2415 (coerceValueToNPString):
2416 (convertValueToNPValueType):
2417 (convertNPValueTypeToValue):
2418 * bindings/c/c_utility.h:
2419 * bindings/npruntime.cpp:
2420 (NPN_IdentifierFromUTF8):
2421 (NPN_IsValidIdentifier):
2422 (NPN_GetIdentifiers):
2423 (NPN_UTF8FromIdentifier):
2426 (NPN_ReleaseObject):
2427 (NPN_IsKindOfClass):
2428 (NPN_SetExceptionWithUTF8):
2431 (NPN_CreateNumberWithInt):
2432 (NPN_CreateNumberWithFloat):
2433 (NPN_CreateNumberWithDouble):
2434 (NPN_IntFromNumber):
2435 (NPN_FloatFromNumber):
2436 (NPN_DoubleFromNumber):
2438 (NPN_CreateStringWithUTF8):
2439 (NPN_CreateStringWithUTF16):
2440 (NPN_DeallocateUTF8):
2441 (NPN_UTF8FromString):
2442 (NPN_UTF16FromString):
2445 (NPN_CreateBoolean):
2446 (NPN_BoolFromBoolean):
2449 (undefinedAllocate):
2455 (NPN_ObjectAtIndex):
2456 * bindings/npruntime.h:
2457 * bindings/runtime.cpp:
2458 (Instance::createBindingForLanguageInstance):
2459 * bindings/testbindings.cpp:
2460 (initializeIdentifiers):
2480 2004-03-31 Richard Williamson <rjw@apple.com>
2482 Changed references to NP_runtime.h to npruntime.h
2484 * JavaScriptCore.pbproj/project.pbxproj:
2485 * bindings/NP_jsobject.h:
2486 * bindings/c/c_class.h:
2487 * bindings/c/c_instance.h:
2488 * bindings/c/c_runtime.h:
2489 * bindings/c/c_utility.h:
2490 * bindings/npruntime.cpp:
2492 2004-03-31 Richard Williamson <rjw@apple.com>
2494 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2496 * JavaScriptCore.pbproj/project.pbxproj:
2497 * bindings/NP_jsobject.h:
2498 * bindings/npruntime.cpp:
2502 2004-03-23 Richard Williamson <rjw@apple.com>
2504 Added implementation of KJS::Value <-> NP_Object conversion functions.
2505 Augmented test program for 'C' bindings.
2506 Added asserts and parameter checking to all public API.
2510 * JavaScriptCore.pbproj/project.pbxproj:
2511 * bindings/NP_jsobject.cpp:
2513 * bindings/NP_jsobject.h: Added.
2514 * bindings/NP_runtime.cpp:
2515 (NP_IdentifierFromUTF8):
2516 (NP_IsValidIdentifier):
2517 (NP_GetIdentifiers):
2522 (NP_SetExceptionWithUTF8):
2525 (NP_FloatFromNumber):
2526 (NP_DoubleFromNumber):
2527 (NP_CreateStringWithUTF8):
2528 (NP_CreateStringWithUTF16):
2529 (NP_DeallocateUTF8):
2530 (NP_UTF8FromString):
2531 (NP_UTF16FromString):
2533 (NP_BoolFromBoolean):
2534 * bindings/NP_runtime.h:
2535 * bindings/c/c_instance.cpp:
2536 (CInstance::invokeMethod):
2537 * bindings/c/c_utility.cpp:
2538 (coerceValueToNPString):
2539 (convertValueToNPValueType):
2540 (convertNPValueTypeToValue):
2541 * bindings/c/c_utility.h:
2543 * bindings/testC.js: Added.
2544 * bindings/testbindings.cpp:
2554 (myInterfaceInvoke):
2555 (myInterfaceAllocate):
2559 2004-03-19 Darin Adler <darin@apple.com>
2563 - fixed problem with methods like setUTCHour
2565 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2566 GMT vs. local time function based on the utc flag.
2568 2004-03-17 Richard Williamson <rjw@apple.com>
2570 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2574 * bindings/NP_jsobject.cpp:
2579 (NP_GetPropertyAtIndex):
2580 * bindings/NP_runtime.h:
2582 2004-03-16 Richard Williamson <rjw@apple.com>
2584 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.
2588 * bindings/jni/jni_class.cpp:
2589 (JavaClass::methodsNamed):
2591 2004-03-15 Richard Williamson <rjw@apple.com>
2593 Fixed 3570854. Don't attempt to convert Null to strings. We
2594 were incorrectly converting to "Null".
2596 Actually fixed by Scott Kovatch.
2598 Reviewed by Richard.
2600 * bindings/jni/jni_utility.cpp:
2601 (KJS::Bindings::convertValueToJValue):
2605 2004-03-11 Richard Williamson <rjw@apple.com>
2607 Stitched together the NP stuff to our language independent
2608 JavaScript binding stuff. Very close to being done.
2610 Added program to test C bindings (and NP stuff). Just tests
2611 properties. Will add methods and JavaScript access, etc.
2613 Updated Makefile.am to account for new bindings/c directory.
2615 Change NP_UTF8 from "const char *" to "char" to allow for
2616 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
2619 Added NP_IsValidIdentifier().
2623 * JavaScriptCore.pbproj/project.pbxproj:
2625 * bindings/NP_jsobject.cpp:
2626 (identiferFromNPIdentifier):
2628 * bindings/NP_runtime.cpp:
2629 (NP_IdentifierFromUTF8):
2630 (NP_IsValidIdentifier):
2631 (NP_GetIdentifiers):
2632 (NP_UTF8FromIdentifier):
2633 (NP_SetExceptionWithUTF8):
2635 (NP_CreateStringWithUTF8):
2636 (NP_CreateStringWithUTF16):
2637 (NP_UTF8FromString):
2638 (NP_UTF16FromString):
2639 * bindings/NP_runtime.h:
2640 * bindings/c/c_class.cpp: Added.
2641 (CClass::_commonDelete):
2642 (CClass::_commonCopy):
2643 (CClass::_commonInit):
2644 (_createClassesByIsAIfNecessary):
2645 (CClass::classForIsA):
2648 (CClass::methodsNamed):
2649 (CClass::fieldNamed):
2650 * bindings/c/c_class.h: Added.
2651 (KJS::Bindings::CClass::~CClass):
2652 (KJS::Bindings::CClass::CClass):
2653 (KJS::Bindings::CClass::operator=):
2654 (KJS::Bindings::CClass::constructorAt):
2655 (KJS::Bindings::CClass::numConstructors):
2656 * bindings/c/c_instance.cpp: Added.
2657 (CInstance::CInstance):
2658 (CInstance::~CInstance):
2659 (CInstance::operator=):
2660 (CInstance::getClass):
2663 (CInstance::invokeMethod):
2664 (CInstance::defaultValue):
2665 (CInstance::stringValue):
2666 (CInstance::numberValue):
2667 (CInstance::booleanValue):
2668 (CInstance::valueOf):
2669 * bindings/c/c_instance.h: Added.
2670 (KJS::Bindings::CInstance::getObject):
2671 * bindings/c/c_runtime.cpp: Added.
2672 (CField::valueFromInstance):
2673 (CField::setValueToInstance):
2674 * bindings/c/c_runtime.h: Added.
2675 (KJS::Bindings::CField::CField):
2676 (KJS::Bindings::CField::name):
2677 (KJS::Bindings::CField::type):
2678 (KJS::Bindings::CMethod::CMethod):
2679 (KJS::Bindings::CMethod::name):
2680 (KJS::Bindings::CMethod::numParameters):
2681 * bindings/c/c_utility.cpp: Added.
2682 (coerceValueToNPValueType):
2683 (convertValueToNPValueType):
2684 (convertNPValueTypeToValue):
2685 * bindings/c/c_utility.h: Added.
2686 * bindings/make_testbindings:
2687 * bindings/runtime.cpp:
2688 (Instance::createBindingForLanguageInstance):
2689 * bindings/runtime.h:
2690 (KJS::Bindings::Instance::):
2691 * bindings/testbindings.cpp: Added.
2692 (initializeIdentifiers):
2693 (myInterfaceHasProperty):
2694 (myInterfaceHasMethod):
2695 (myInterfaceGetProperty):
2696 (myInterfaceSetProperty):
2697 (myInterfaceInvoke):
2698 (myInterfaceAllocate):
2699 (myInterfaceInvalidate):
2700 (myInterfaceDeallocate):
2701 (GlobalImp::className):
2702 (readJavaScriptFromFile):
2705 2004-03-10 Richard Williamson <rjw@apple.com>
2707 Made changes to support new asychronous approach to calls from
2708 plugin to JavaScript
2712 * bindings/NP_jsobject.cpp:
2717 (NP_GetPropertyAtIndex):
2718 * bindings/NP_runtime.h:
2719 * bindings/make_testbindings:
2720 * bindings/runtime.cpp:
2721 (Instance::createBindingForLanguageInstance):
2723 2004-03-10 Richard Williamson <rjw@apple.com>
2725 Updated header to include proposed changes from
2726 plugin-futures list. Calls from plugin to JavaScript
2727 are now asynchronous.
2731 * bindings/NP_runtime.h:
2735 2004-03-04 Richard Williamson <rjw@apple.com>
2737 Implementation of NP_JavaScriptObject. This is the 'C' class
2738 that wraps a JavaScript object.
2742 * JavaScriptCore.pbproj/project.pbxproj:
2743 * bindings/NP_jsobject.cpp: Added.
2744 (coerceValueToNPValueType):
2745 (convertValueToNPValueType):
2746 (convertNPValueTypeToValue):
2750 (identiferFromNPIdentifier):
2755 (NP_RemoveProperty):
2757 (NP_GetPropertyAtIndex):
2758 (NP_SetPropertyAtIndex):
2759 * bindings/NP_runtime.cpp:
2761 * bindings/NP_runtime.h:
2762 * bindings/runtime_object.h:
2764 2004-03-04 Richard Williamson <rjw@apple.com>
2766 Added NP_Array implementation.
2768 Changed NP_Boolean to just depend on two static instances, no
2769 space is required for values.
2773 * bindings/NP_runtime.cpp:
2775 (NP_BoolFromBoolean):
2781 * bindings/NP_runtime.h:
2783 2004-03-03 Darin Adler <darin@apple.com>
2787 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
2788 copyright string, and that's all that was in here.
2789 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
2791 2004-03-03 Richard Williamson <rjw@apple.com>
2793 More 'C' binding implementation. Fleshed out all the
2794 'primitive' data types.
2798 * bindings/NP_runtime.cpp:
2803 (NP_CreateStringWithUTF8):
2804 (NP_CreateStringWithUTF16):
2805 (NP_UTF8FromString):
2806 (NP_UTF16FromString):
2809 (booleanDeallocate):
2811 (NP_BoolFromBoolean):
2815 (undefinedAllocate):
2816 (undefinedDeallocate):
2818 * bindings/NP_runtime.h:
2820 2004-03-03 Richard Williamson <rjw@apple.com>
2822 More 'C' binding implementation.
2826 * bindings/NP_runtime.cpp:
2829 (getIdentifierDictionary):
2830 (NP_IdentifierFromUTF8):
2831 (NP_UTF8FromIdentifier):
2836 (NP_CreateNumberWithInt):
2837 (NP_CreateNumberWithFloat):
2838 (NP_CreateNumberWithDouble):
2840 (NP_FloatFromNumber):
2841 (NP_DoubleFromNumber):
2842 * bindings/NP_runtime.h:
2844 2004-03-02 Richard Williamson <rjw@apple.com>
2846 Removed retain/release from NP_Class. Classes will not be allowed to implement their
2847 own customer retain/release scheme.
2851 * bindings/NP_runtime.cpp:
2854 * bindings/NP_runtime.h:
2856 2004-03-02 Richard Williamson <rjw@apple.com>
2858 C binding API. Partial implementation.
2860 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.
2862 Factored root object reference counting scheme. It is now useful independent
2867 * JavaScriptCore.pbproj/project.pbxproj:
2868 * bindings/NP_runtime.cpp: Added.
2869 (NP_IdentifierFromUTF8):
2870 (NP_GetIdentifiers):
2871 (NP_UTF8FromIdentifier):
2881 (NP_RemoveProperty):
2883 (NP_GetPropertyAtIndex):
2884 (NP_SetPropertyAtIndex):
2885 (NP_CreateNumberWithInt):
2886 (NP_CreateNumberWithFloat):
2887 (NP_CreateNumberWithDouble):
2889 (NP_FloatFromNumber):
2890 (NP_DoubleFromNumber):
2891 (NP_CreateStringWithUTF8):
2892 (NP_CreateStringWithUTF16):
2893 (NP_UTF8FromString):
2894 (NP_UTF16FromString):
2896 (NP_BoolFromBoolean):
2902 * bindings/NP_runtime.h: Added.
2903 * bindings/jni/jni_jsobject.cpp:
2905 (JSObject::finalize):
2906 (JSObject::createNative):
2907 (JSObject::convertValueToJObject):
2908 * bindings/jni/jni_jsobject.h:
2909 * bindings/objc/objc_jsobject.h:
2910 * bindings/objc/objc_jsobject.mm:
2912 (windowJavaScriptObject):
2913 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2914 (-[JavaScriptObject dealloc]):
2915 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
2916 (-[JavaScriptObject call:arguments:]):
2917 (-[JavaScriptObject evaluate:]):
2918 (-[JavaScriptObject getMember:]):
2919 (-[JavaScriptObject setMember:value:]):
2920 (-[JavaScriptObject removeMember:]):
2921 (-[JavaScriptObject toString]):
2922 (-[JavaScriptObject getSlot:]):
2923 (-[JavaScriptObject setSlot:value:]):
2924 * bindings/objc/objc_utility.h:
2925 * bindings/objc/objc_utility.mm:
2926 (KJS::Bindings::convertValueToObjcValue):
2927 * bindings/runtime_root.cpp: Added.
2928 (getReferencesByRootDictionary):
2929 (getReferencesDictionary):
2930 (KJS::Bindings::findReferenceDictionary):
2931 (KJS::Bindings::rootForImp):
2932 (KJS::Bindings::addNativeReference):
2933 (KJS::Bindings::removeNativeReference):
2934 (completedJavaScriptAccess):
2935 (initializeJavaScriptAccessLock):
2936 (lockJavaScriptAccess):
2937 (unlockJavaScriptAccess):
2938 (RootObject::dispatchToJavaScriptThread):
2939 (performJavaScriptAccess):
2940 (RootObject::setFindRootObjectForNativeHandleFunction):
2941 (RootObject::removeAllNativeReferences):
2942 * bindings/runtime_root.h: Added.
2943 (KJS::Bindings::RootObject::RootObject):
2944 (KJS::Bindings::RootObject::~RootObject):
2945 (KJS::Bindings::RootObject::setRootObjectImp):
2946 (KJS::Bindings::RootObject::rootObjectImp):
2947 (KJS::Bindings::RootObject::setInterpreter):
2948 (KJS::Bindings::RootObject::interpreter):
2949 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
2950 (KJS::Bindings::RootObject::runLoop):
2951 (KJS::Bindings::RootObject::performJavaScriptSource):
2957 2004-02-18 Richard Williamson <rjw@apple.com>
2959 Added NSNumber/Number conversion.
2961 Removed some unnecessary KJS:: namespace specifiers.
2965 * bindings/objc/objc_utility.mm:
2966 (KJS::Bindings::convertValueToObjcValue):
2967 (KJS::Bindings::convertObjcValueToValue):
2968 * bindings/runtime_array.h:
2970 2004-02-18 Richard Williamson <rjw@apple.com>
2972 Added support for export NSArrays.
2974 Updated valueAt() to take an ExecState so we can throw
2977 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
2978 ObjectiveC classes to control the visibility of their methods in
2983 * bindings/jni/jni_runtime.cpp:
2984 (JavaField::valueFromInstance):
2985 (JavaArray::valueAt):
2986 * bindings/jni/jni_runtime.h:
2987 * bindings/objc/objc_class.mm:
2988 (ObjcClass::methodsNamed):
2989 * bindings/objc/objc_runtime.h:
2990 (KJS::Bindings::ObjcArray::getObjcArray):
2991 * bindings/objc/objc_runtime.mm:
2992 (ObjcField::valueFromInstance):
2993 (ObjcField::setValueToInstance):
2994 (ObjcArray::ObjcArray):
2995 (ObjcArray::~ObjcArray):
2996 (ObjcArray::operator=):
2997 (ObjcArray::setValueAt):
2998 (ObjcArray::valueAt):
2999 (ObjcArray::getLength):
3000 * bindings/objc/objc_utility.mm:
3001 (KJS::Bindings::convertValueToObjcValue):
3002 (KJS::Bindings::convertObjcValueToValue):
3003 * bindings/runtime.cpp:
3004 (Instance::getValueOfField):
3005 * bindings/runtime.h:
3006 * bindings/runtime_array.cpp:
3007 (RuntimeArrayImp::get):
3008 * bindings/runtime_object.cpp:
3009 (RuntimeObjectImp::get):
3011 2004-02-17 Richard Williamson <rjw@apple.com>
3013 Added String <-> NSString conversion.
3014 Added tests of String <-> NSString conversion to test program.
3018 * bindings/objc/objc_utility.mm:
3019 (KJS::Bindings::convertValueToObjcValue):
3020 (KJS::Bindings::convertObjcValueToValue):
3022 * bindings/testbindings.mm:
3023 (-[MyFirstInterface getString]):
3025 2004-02-15 Darin Adler <darin@apple.com>
3029 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3030 and removing redundant settings of things that match defaults in other build styles.
3032 2004-02-13 Richard Williamson <rjw@apple.com>
3034 Work towards the JavaScript ObjC bindings. The bindings now work for
3035 simple scalar types. testbindings.mm is an illustration of how the
3040 * JavaScriptCore.pbproj/project.pbxproj:
3042 * bindings/jni/jni_class.cpp:
3043 (JavaClass::methodsNamed):
3044 * bindings/jni/jni_class.h:
3045 * bindings/jni/jni_instance.cpp:
3046 (JavaInstance::invokeMethod):
3047 * bindings/jni/jni_instance.h:
3048 * bindings/jni/jni_runtime.h:
3049 (KJS::Bindings::JavaMethod::returnType):
3050 * bindings/make_testbindings: Added.
3051 * bindings/objc/objc_class.h: Added.
3052 (KJS::Bindings::ObjcClass::~ObjcClass):
3053 (KJS::Bindings::ObjcClass::ObjcClass):
3054 (KJS::Bindings::ObjcClass::operator=):
3055 (KJS::Bindings::ObjcClass::constructorAt):
3056 (KJS::Bindings::ObjcClass::numConstructors):
3057 * bindings/objc/objc_class.mm: Added.
3058 (ObjcClass::_commonDelete):
3059 (ObjcClass::_commonCopy):
3060 (ObjcClass::_commonInit):
3061 (_createClassesByIsAIfNecessary):
3062 (ObjcClass::classForIsA):
3063 (ObjcClass::ObjcClass):
3065 (ObjcClass::methodsNamed):
3066 (ObjcClass::fieldNamed):
3067 * bindings/objc/objc_header.h: Added.
3068 * bindings/objc/objc_instance.h: Added.
3069 (KJS::Bindings::ObjcInstance::getObject):
3070 * bindings/objc/objc_instance.mm: Added.
3071 (ObjcInstance::ObjcInstance):
3072 (ObjcInstance::~ObjcInstance):
3073 (ObjcInstance::operator=):
3074 (ObjcInstance::begin):
3075 (ObjcInstance::end):
3076 (ObjcInstance::getClass):
3077 (ObjcInstance::invokeMethod):
3078 (ObjcInstance::defaultValue):
3079 (ObjcInstance::stringValue):
3080 (ObjcInstance::numberValue):
3081 (ObjcInstance::booleanValue):
3082 (ObjcInstance::valueOf):
3083 * bindings/objc/objc_jsobject.h: Added.
3084 * bindings/objc/objc_jsobject.mm: Added.
3085 * bindings/objc/objc_runtime.h:
3086 (KJS::Bindings::ObjcField::~ObjcField):
3087 (KJS::Bindings::ObjcField::ObjcField):
3088 (KJS::Bindings::ObjcField::operator=):
3089 (KJS::Bindings::ObjcMethod::ObjcMethod):
3090 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3091 (KJS::Bindings::ObjcMethod::operator=):
3092 * bindings/objc/objc_runtime.mm: Added.
3093 (ObjcMethod::ObjcMethod):
3095 (ObjcMethod::numParameters):
3096 (ObjcMethod::getMethodSignature):
3097 (ObjcField::ObjcField):
3100 (ObjcField::valueFromInstance):
3101 (ObjcField::setValueToInstance):
3102 * bindings/objc/objc_utility.h: Added.
3104 * bindings/objc/objc_utility.mm: Added.
3105 (KJS::Bindings::JSMethodNameToObjCMethodName):
3106 (KJS::Bindings::convertValueToObjcValue):
3107 (KJS::Bindings::convertObjcValueToValue):
3108 (KJS::Bindings::objcValueTypeForType):
3109 * bindings/runtime.cpp:
3110 (MethodList::MethodList):
3111 (MethodList::operator=):
3112 (Instance::setValueOfField):
3113 (Instance::createBindingForLanguageInstance):
3114 (Instance::createRuntimeObject):
3115 * bindings/runtime.h:
3116 * bindings/runtime_method.cpp:
3117 (RuntimeMethodImp::RuntimeMethodImp):
3118 (RuntimeMethodImp::get):
3119 (RuntimeMethodImp::call):
3120 * bindings/runtime_method.h:
3121 * bindings/runtime_object.cpp:
3122 (RuntimeObjectImp::get):
3123 (RuntimeObjectImp::hasProperty):
3124 * bindings/test.js: Added.
3125 * bindings/testbindings.mm: Added.
3126 (-[MySecondInterface init]):
3127 (-[MyFirstInterface init]):
3128 (-[MyFirstInterface dealloc]):
3129 (+[MyFirstInterface JavaScriptNameForSelector:]):
3130 (-[MyFirstInterface getInt]):
3131 (-[MyFirstInterface setInt:]):
3132 (-[MyFirstInterface getMySecondInterface]):
3133 (-[MyFirstInterface logMessage:]):
3134 (GlobalImp::className):
3135 (readJavaScriptFromFile):
3140 2004-02-08 Darin Adler <darin@apple.com>
3144 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3146 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3147 macros from working right in C++ code that uses the <cctype> header.
3150 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3151 (KJS::UTF8SequenceLengthNonASCII): Added.
3152 (KJS::inlineUTF8SequenceLength): Added.
3153 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3154 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3155 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3156 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3157 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3159 - fixed the test program so it won't hit the interpreter lock assertion
3161 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3165 2004-02-06 Richard Williamson <rjw@apple.com>
3167 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.
3171 * bindings/jni/jni_jsobject.cpp:
3172 (JSObject::toString):
3173 * bindings/jni/jni_utility.cpp:
3174 (KJS::Bindings::convertValueToJValue):
3176 2004-02-02 Darin Adler <darin@apple.com>
3180 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3182 * kjs/array_object.cpp:
3183 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3184 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3185 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3186 number is out of range. This prevents new Array(-1) from causing trouble.
3188 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3190 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3191 casting to int. Results now match those in other browsers.
3193 2004-02-02 Darin Adler <darin@apple.com>
3197 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3198 - fixed other related overflow issues
3200 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3202 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3203 must not restrict values to the range of a particular integer type.
3204 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3205 proper handling for negative results from fmod.
3206 (ValueImp::toUInt32): Ditto.
3207 (ValueImp::toUInt16): Ditto.
3208 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3210 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3211 out-of-integer-range values better in the slice function.
3212 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3213 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3214 out-of-integer-range values better in the toString function.
3215 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3216 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3217 and substr functions.
3221 2004-01-30 Richard Williamson <rjw@apple.com>
3223 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3227 * bindings/jni/jni_instance.cpp:
3228 (JavaInstance::stringValue):
3230 2004-01-26 Darin Adler <darin@apple.com>
3232 * Makefile.am: Switch from pbxbuild to xcodebuild.
3234 2004-01-22 Richard Williamson <rjw@apple.com>
3236 Added stubs for ObjC language binding to JavaScript.
3238 * JavaScriptCore.pbproj/project.pbxproj:
3239 * bindings/jni/jni_runtime.h:
3240 * bindings/objc/objc_runtime.h: Added.
3241 (KJS::Bindings::ObjcParameter::ObjcParameter):
3242 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3243 (KJS::Bindings::ObjcParameter::operator=):
3244 (KJS::Bindings::ObjcParameter::type):
3245 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3246 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3247 (KJS::Bindings::ObjcConstructor::_commonCopy):
3248 (KJS::Bindings::ObjcConstructor::operator=):
3249 (KJS::Bindings::ObjcConstructor::value):
3250 (KJS::Bindings::ObjcConstructor::parameterAt):
3251 (KJS::Bindings::ObjcConstructor::numParameters):
3252 (KJS::Bindings::ObjcField::ObjcField):
3253 (KJS::Bindings::ObjcField::~ObjcField):
3254 * bindings/runtime.h:
3256 2004-01-22 Richard Williamson <rjw@apple.com>
3258 Simplified JavaString by using UString as backing store. This
3259 revealed a bug in CString's assignment operator which I fixed.
3261 Removed some dead code.
3265 * bindings/jni/jni_runtime.h:
3266 (KJS::Bindings::JavaString::JavaString):
3267 (KJS::Bindings::JavaString::_commonInit):
3268 (KJS::Bindings::JavaString::UTF8String):
3269 (KJS::Bindings::JavaString::uchars):
3270 (KJS::Bindings::JavaString::length):
3271 (KJS::Bindings::JavaString::ustring):
3272 * bindings/runtime_object.cpp:
3273 (RuntimeObjectImp::RuntimeObjectImp):
3274 * bindings/runtime_object.h:
3276 (KJS::CString::CString):
3277 (KJS::CString::operator=):
3283 2004-01-16 Richard Williamson <rjw@apple.com>
3285 Fixed 3525853. We weren't handling mapping to overloaded Java
3286 methods very well. Even though this is undefined the other
3287 browsers support it. Also fixed a bug with returning arrays
3288 from Java functions.
3292 * bindings/jni/jni_class.cpp:
3293 (JavaClass::_commonInit):
3294 (JavaClass::methodsNamed):
3295 * bindings/jni/jni_class.h:
3296 * bindings/jni/jni_instance.cpp:
3297 (JavaInstance::invokeMethod):
3298 * bindings/jni/jni_instance.h:
3299 * bindings/jni/jni_runtime.cpp:
3300 (JavaArray::convertJObjectToArray):
3301 (JavaField::valueFromInstance):
3302 (JavaMethod::signature):
3303 (JavaArray::valueAt):
3304 * bindings/jni/jni_runtime.h:
3305 * bindings/jni_jsobject.cpp:
3307 (JSObject::convertJObjectToValue):
3308 * bindings/runtime.cpp:
3309 (MethodList::addMethod):
3310 (MethodList::length):
3311 (MethodList::methodAt):
3312 (MethodList::~MethodList):
3313 * bindings/runtime.h:
3314 (KJS::Bindings::MethodList::MethodList):
3315 * bindings/runtime_method.cpp:
3316 (RuntimeMethodImp::RuntimeMethodImp):
3317 (RuntimeMethodImp::get):
3318 (RuntimeMethodImp::call):
3319 * bindings/runtime_method.h:
3320 * bindings/runtime_object.cpp:
3321 (RuntimeObjectImp::get):
3322 (RuntimeObjectImp::hasProperty):
3324 2004-01-16 Richard Williamson <rjw@apple.com>
3326 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3327 protection implemented for 3530401.
3331 * bindings/runtime_method.cpp:
3332 (RuntimeMethodImp::call):
3334 2004-01-15 Richard Williamson <rjw@apple.com>
3336 Fixed 3530401. JNI doesn't cleanup local refs created on the
3337 main thread. IMO this is a bad bug in our JMI implementation.
3339 To work-around the problem I explicitly delete all local refs.
3340 Further, I've added Push/PopLocalFrame calls to catch any refs
3341 that I may have missed. This will guarantee that we don't leak
3342 any Java references.
3346 * bindings/jni/jni_class.cpp:
3347 (JavaClass::_commonInit):
3348 (JavaClass::JavaClass):
3349 * bindings/jni/jni_instance.cpp:
3350 (JavaInstance::begin):
3351 (JavaInstance::end):
3352 * bindings/jni/jni_instance.h:
3353 * bindings/jni/jni_runtime.cpp:
3354 (JavaConstructor::JavaConstructor):
3355 (JavaMethod::JavaMethod):
3356 * bindings/jni_jsobject.cpp:
3357 (JSObject::listFromJArray):
3358 * bindings/runtime.h:
3359 (KJS::Bindings::Instance::begin):
3360 (KJS::Bindings::Instance::end):
3361 * bindings/runtime_object.cpp:
3362 (RuntimeObjectImp::get):
3363 (RuntimeObjectImp::put):
3364 (RuntimeObjectImp::canPut):
3365 (RuntimeObjectImp::hasProperty):
3366 (RuntimeObjectImp::defaultValue):
3368 2004-01-15 Vicki Murley <vicki@apple.com>
3372 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3374 2004-01-14 Richard Williamson <rjw@apple.com>
3376 Fixed 3529466. With recent changes to Java plugin we must no
3377 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3381 * bindings/jni/jni_instance.cpp:
3382 (JObjectWrapper::JObjectWrapper):
3386 2004-01-14 Richard Williamson <rjw@apple.com>
3390 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.
3394 * bindings/jni_jsobject.cpp:
3396 (removeJavaReference):
3397 (RootObject::removeAllJavaReferencesForRoot):
3400 2004-01-13 Richard Williamson <rjw@apple.com>
3404 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.
3408 * bindings/jni_jsobject.h:
3409 (KJS::Bindings::RootObject::~RootObject):
3415 2004-01-06 Richard Williamson <rjw@apple.com>
3417 Fixed 3521814. Finalize messages weren't being dispatched!
3421 * bindings/jni_jsobject.cpp:
3424 2004-01-05 Richard Williamson <rjw@apple.com>
3426 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
3427 described by 3515579.
3429 Also cleanup up logging of Java exceptions.
3433 * bindings/jni/jni_class.cpp:
3434 (JavaClass::classForInstance):
3435 * bindings/jni/jni_instance.cpp:
3436 (JavaInstance::JavaInstance):
3437 (JavaInstance::getClass):
3438 (JavaInstance::invokeMethod):
3439 (JObjectWrapper::JObjectWrapper):
3440 (JObjectWrapper::~JObjectWrapper):
3441 * bindings/jni/jni_instance.h:
3442 (KJS::Bindings::JavaInstance::operator=):
3443 * bindings/jni/jni_runtime.cpp:
3444 (JavaMethod::JavaMethod):
3445 (JavaMethod::methodID):
3446 * bindings/jni/jni_runtime.h:
3447 (KJS::Bindings::JavaMethod::JavaMethod):
3448 * bindings/jni/jni_utility.cpp:
3452 (KJS::Bindings::getMethodID):
3453 (KJS::Bindings::callJNIVoidMethodIDA):
3454 (KJS::Bindings::callJNIObjectMethodIDA):
3455 (KJS::Bindings::callJNIByteMethodIDA):
3456 (KJS::Bindings::callJNICharMethodIDA):
3457 (KJS::Bindings::callJNIShortMethodIDA):
3458 (KJS::Bindings::callJNIIntMethodIDA):
3459 (KJS::Bindings::callJNILongMethodIDA):
3460 (KJS::Bindings::callJNIFloatMethodIDA):
3461 (KJS::Bindings::callJNIDoubleMethodIDA):
3462 (KJS::Bindings::callJNIBooleanMethodIDA):
3463 (KJS::Bindings::getCharactersFromJStringInEnv):
3464 (KJS::Bindings::getUCharactersFromJStringInEnv):
3465 (KJS::Bindings::getJNIField):
3466 * bindings/jni/jni_utility.h:
3468 l2003-12-23 John Sullivan <sullivan@apple.com>
3470 * JavaScriptCore.pbproj/project.pbxproj:
3471 Xcode version wars, harmless
3473 2003-12-23 Darin Adler <darin@apple.com>
3475 Reviewed by John (concept, not code, which is just the old code coming back).
3477 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
3479 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
3480 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
3482 2003-12-19 Richard Williamson <rjw@apple.com>
3484 Fixed 3515597. When an error occurs we need
3485 to make sure result values are zeroed.
3487 Cleaned up logs by adding a newline.
3491 * bindings/jni/jni_utility.cpp:
3492 (KJS::Bindings::getJavaVM):
3493 (KJS::Bindings::getJNIEnv):
3496 (KJS::Bindings::getJNIField):
3497 * bindings/jni_jsobject.cpp:
3498 (JSObject::convertValueToJObject):
3502 2003-12-17 Richard Williamson <rjw@apple.com>
3504 Ensure that all the symbols we export are in the KJS
3505 namespace (3512245).
3507 Also renamed JavaString.characters() to JavaString.UTF8String()
3508 for enhanced clarity.
3510 Added some sanity checking to constructor of JObjectWrapper.
3515 * bindings/jni/jni_class.cpp:
3516 * bindings/jni/jni_class.h:
3517 * bindings/jni/jni_instance.cpp:
3518 (JavaInstance::invokeMethod):
3519 (JObjectWrapper::JObjectWrapper):
3520 * bindings/jni/jni_instance.h:
3521 * bindings/jni/jni_runtime.cpp:
3522 (JavaParameter::JavaParameter):
3523 (JavaField::JavaField):
3524 (JavaMethod::JavaMethod):
3525 (JavaMethod::signature):
3526 * bindings/jni/jni_runtime.h:
3527 (KJS::Bindings::JavaString::ascii):
3528 (KJS::Bindings::JavaString::UTF8String):
3529 (KJS::Bindings::JavaString::JavaString):
3530 (KJS::Bindings::JavaString::_commonInit):
3531 (KJS::Bindings::JavaString::uchars):
3532 (KJS::Bindings::JavaString::length):
3533 (KJS::Bindings::JavaString::ustring):
3534 (KJS::Bindings::JavaParameter::type):
3535 (KJS::Bindings::JavaField::name):
3536 (KJS::Bindings::JavaField::type):
3537 (KJS::Bindings::JavaMethod::name):
3538 (KJS::Bindings::JavaMethod::returnType):
3539 * bindings/jni/jni_utility.cpp:
3540 (KJS::Bindings::getJavaVM):
3541 (KJS::Bindings::getJNIEnv):
3542 (KJS::Bindings::callJNIVoidMethod):
3543 (KJS::Bindings::callJNIObjectMethod):
3544 (KJS::Bindings::callJNIBooleanMethod):
3545 (KJS::Bindings::callJNIByteMethod):
3546 (KJS::Bindings::callJNICharMethod):
3547 (KJS::Bindings::callJNIShortMethod):
3548 (KJS::Bindings::callJNIIntMethod):
3549 (KJS::Bindings::callJNILongMethod):
3550 (KJS::Bindings::callJNIFloatMethod):
3551 (KJS::Bindings::callJNIDoubleMethod):
3552 (KJS::Bindings::callJNIVoidMethodA):
3553 (KJS::Bindings::callJNIObjectMethodA):
3554 (KJS::Bindings::callJNIByteMethodA):
3555 (KJS::Bindings::callJNICharMethodA):
3556 (KJS::Bindings::callJNIShortMethodA):
3557 (KJS::Bindings::callJNIIntMethodA):
3558 (KJS::Bindings::callJNILongMethodA):
3559 (KJS::Bindings::callJNIFloatMethodA):
3560 (KJS::Bindings::callJNIDoubleMethodA):
3561 (KJS::Bindings::callJNIBooleanMethodA):
3562 (KJS::Bindings::getCharactersFromJString):
3563 (KJS::Bindings::releaseCharactersForJString):
3564 (KJS::Bindings::getCharactersFromJStringInEnv):
3565 (KJS::Bindings::releaseCharactersForJStringInEnv):
3566 (KJS::Bindings::getUCharactersFromJStringInEnv):
3567 (KJS::Bindings::releaseUCharactersForJStringInEnv):
3568 (KJS::Bindings::JNITypeFromClassName):
3569 (KJS::Bindings::signatureFromPrimitiveType):
3570 (KJS::Bindings::JNITypeFromPrimitiveType):
3571 (KJS::Bindings::getJNIField):
3572 (KJS::Bindings::convertValueToJValue):
3573 * bindings/jni/jni_utility.h:
3574 * bindings/jni_jsobject.cpp:
3575 (KJS::Bindings::JSObject::invoke):