5 2004-12-17 Maciej Stachowiak <mjs@apple.com>
9 <rdar://problem/3926869> Opening caches window after running PLT causes crash
11 * kjs/protected_values.cpp:
12 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
13 the protected value table.
14 (KJS::ProtectedValues::increaseProtectCount): Ditto.
15 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
17 2004-12-16 Darin Adler <darin@apple.com>
21 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
23 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
24 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
25 non-locale-specific versions.
26 * kjs/string_object.lut.h: Regenerated.
28 2004-12-14 Richard Williamson <rjw@apple.com>
30 Pass URL of plugin view when call into JNI.
34 * bindings/jni/jni_objc.mm:
35 (KJS::Bindings::dispatchJNICall):
37 2004-12-13 Richard Williamson <rjw@apple.com>
39 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
41 Add support for calling static Java methods from JavaScript.
45 * bindings/jni/jni_instance.cpp:
46 (JavaInstance::invokeMethod):
47 * bindings/jni/jni_runtime.cpp:
48 (JavaMethod::JavaMethod):
49 * bindings/jni/jni_runtime.h:
50 (KJS::Bindings::JavaMethod::isStatic):
51 * bindings/jni/jni_utility.cpp:
52 (callJNIStaticMethod):
53 (KJS::Bindings::callJNIBooleanMethod):
54 (KJS::Bindings::callJNIStaticBooleanMethod):
55 * bindings/jni/jni_utility.h:
57 2004-12-13 Richard Williamson <rjw@apple.com>
59 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
63 * bindings/jni/jni_instance.cpp:
64 (JavaInstance::invokeMethod):
65 * bindings/jni/jni_objc.mm:
66 (KJS::Bindings::dispatchJNICall):
67 * bindings/jni/jni_runtime.h:
68 * bindings/jni/jni_utility.h:
72 2004-12-07 Maciej Stachowiak <mjs@apple.com>
76 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
78 The fix was to implement copy constructor and assignment operator,
79 the ones that worked on the base class did not replace the
83 (KJS::ProtectedValue::ProtectedValue):
84 (KJS::ProtectedValue::operator=):
85 (KJS::ProtectedObject::ProtectedObject):
86 (KJS::ProtectedObject::operator=):
88 Also fixed a bug in the GC test mode that compares the results of
89 the old collector and the new collector.
96 2004-11-23 Richard Williamson <rjw@apple.com>
98 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
102 * bindings/c/c_class.cpp:
103 (CClass::_commonInit):
105 2004-11-21 Maciej Stachowiak <mjs@apple.com>
109 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
112 (KJS::Collector::Thread::Thread):
113 (KJS::destroyRegisteredThread):
114 (KJS::initializeRegisteredThreadKey):
115 (KJS::Collector::registerThread):
116 (KJS::Collector::markStackObjectsConservatively):
117 (KJS::Collector::markCurrentThreadConservatively):
118 (KJS::Collector::markOtherThreadConservatively):
126 2004-11-15 Richard Williamson <rjw@apple.com>
128 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
132 * bindings/objc/objc_instance.mm:
133 (ObjcInstance::stringValue):
134 * bindings/objc/objc_utility.h:
135 * bindings/objc/objc_utility.mm:
136 (KJS::Bindings::convertNSStringToString):
137 (KJS::Bindings::convertObjcValueToValue):
141 2004-11-09 Chris Blumenberg <cblu@apple.com>
143 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
148 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
149 * bindings/softlinking.c: Added.
151 (getFunctionPointer): new
152 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
156 2004-11-04 Darin Adler <darin@apple.com>
160 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
161 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
162 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
163 than allocating a new one
165 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
166 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
167 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
168 actually allocate only the very first time it's called.
169 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
170 shared instance since there can be only one).
171 (-[WebUndefined copyWithZone:]): Ditto.
172 (-[WebUndefined retain]): Ditto.
173 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
175 (-[WebUndefined autorelease]): Simplified to just return self (see above).
176 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
177 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
178 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
179 bug mentioned above).
180 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
181 No need to call init, since that's a no-op for this class.
183 2004-11-03 David Harrison <harrison@apple.com>
187 Eliminate the use of a marker file to determine how to build.
192 2004-11-01 Richard Williamson <rjw@apple.com>
194 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
198 * bindings/c/c_instance.cpp:
199 (CInstance::invokeMethod):
200 (CInstance::invokeDefaultMethod):
201 Initialize out parameters to void type.
203 * bindings/c/c_runtime.cpp:
204 (CField::valueFromInstance):
205 (CField::setValueToInstance):
206 Initialize out parameters to void type.
207 Also added additional checks to protect against classes that
208 don't implement all functions.
210 2004-11-01 Richard Williamson <rjw@apple.com>
212 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
217 * bindings/objc/WebScriptObject.mm:
218 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
219 Added additional conversion Undefined -> WebUndefined.
220 * bindings/objc/objc_utility.mm:
221 (KJS::Bindings::convertObjcValueToValue):
222 Added additional conversion WebUndefined -> Undefined.
224 2004-11-01 Darin Adler <darin@apple.com>
226 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
228 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
229 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
230 report to match the contents of the file.
236 2004-10-22 Ken Kocienda <kocienda@apple.com>
240 * JavaScriptCore.pbproj/project.pbxproj:
241 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
245 2004-10-13 Richard Williamson <rjw@apple.com>
247 Moved boolean checks prior to NSNumber checks. booleans are
250 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
254 * bindings/objc/objc_utility.mm:
255 (KJS::Bindings::convertObjcValueToValue):
257 2004-10-12 Richard Williamson <rjw@apple.com>
259 Fixed access to DOM object via WebScriptObject API.
260 The execution context for DOM objects wasn't being found.
261 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
265 * bindings/objc/WebScriptObject.mm:
267 (-[WebScriptObject KJS::Bindings::]):
268 (-[WebScriptObject callWebScriptMethod:withArguments:]):
269 (-[WebScriptObject evaluateWebScript:]):
270 (-[WebScriptObject setValue:forKey:]):
271 (-[WebScriptObject valueForKey:]):
272 (-[WebScriptObject stringRepresentation]):
273 * bindings/objc/WebScriptObjectPrivate.h:
275 2004-10-09 Darin Adler <darin@apple.com>
279 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
281 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
282 creating an init routine.
284 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
285 require a global constructor that creates an init routine.
287 2004-10-09 Darin Adler <darin@apple.com>
291 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
293 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
294 work with the window object of the page the function is in, not the page of the caller. This
295 is what all other browsers do. This code was hidden before by the "everything is defined on
296 window object" hack in WebCore.
298 2004-10-07 Richard Williamson <rjw@apple.com>
300 Added simple JavaScript call tracing. Very useful for
301 debugging complex pages.
303 Tracing is only available in development builds and is
306 (gdb) set traceJavaScript = 1
310 setTraceJavaScript(true)
312 Function, args, and return values are printed to console. Very
317 * kjs/function_object.cpp:
318 (FunctionProtoFuncImp::call):
324 2004-10-05 Richard Williamson <rjw@apple.com>
326 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
330 * bindings/NP_jsobject.cpp:
332 * bindings/npruntime.cpp:
333 (_NPN_SetExceptionWithUTF8):
334 * bindings/objc/WebScriptObject.mm:
335 (+[WebScriptObject throwException:]):
337 (KJS::InterpreterImp::context):
339 2004-10-05 Richard Williamson <rjw@apple.com>
341 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
345 * bindings/objc/objc_utility.mm:
346 (KJS::Bindings::convertObjcValueToValue):
348 2004-10-04 Darin Adler <darin@apple.com>
352 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
354 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
356 - rolled out an old workaround we don't need any more
358 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
359 required it is no longer there.
361 2004-09-30 Richard Williamson <rjw@apple.com>
363 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
367 * bindings/NP_jsobject.cpp:
371 * bindings/c/c_class.cpp:
372 (CClass::methodsNamed):
373 (CClass::fieldNamed):
374 * bindings/c/c_class.h:
375 * bindings/c/c_instance.cpp:
376 (CInstance::invokeMethod):
377 * bindings/jni/jni_class.cpp:
378 (JavaClass::methodsNamed):
379 * bindings/jni/jni_class.h:
380 * bindings/npruntime.h:
381 * bindings/objc/objc_class.h:
382 * bindings/objc/objc_class.mm:
383 (ObjcClass::methodsNamed):
384 * bindings/runtime.h:
385 * bindings/runtime_object.cpp:
386 (RuntimeObjectImp::get):
387 (RuntimeObjectImp::hasProperty):
389 2004-09-29 Chris Blumenberg <cblu@apple.com>
391 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.
395 * JavaScriptCore.pbproj/project.pbxproj:
396 * bindings/NP_jsobject.cpp:
397 (_NPN_CreateScriptObject):
398 (_NPN_InvokeDefault):
403 (_NPN_RemoveProperty):
406 * bindings/c/c_class.cpp:
407 (CClass::methodsNamed):
408 (CClass::fieldNamed):
409 * bindings/c/c_instance.cpp:
410 (CInstance::CInstance):
411 (CInstance::~CInstance):
412 (CInstance::operator=):
413 (CInstance::invokeMethod):
414 (CInstance::invokeDefaultMethod):
415 * bindings/c/c_runtime.cpp:
416 * bindings/c/c_runtime.h:
417 (KJS::Bindings::CField::name):
418 (KJS::Bindings::CMethod::name):
419 * bindings/npruntime.cpp:
420 (_NPN_GetStringIdentifier):
421 (_NPN_GetStringIdentifiers):
422 (_NPN_GetIntIdentifier):
423 (_NPN_IdentifierIsString):
424 (_NPN_UTF8FromIdentifier):
425 (_NPN_IntFromIdentifier):
426 (NPN_InitializeVariantWithObject):
427 (_NPN_ReleaseVariantValue):
430 (_NPN_ReleaseObject):
431 (_NPN_SetExceptionWithUTF8):
434 2004-09-26 Darin Adler <darin@apple.com>
436 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
437 low() to get Unicode value of character, and just use unicode().
439 2004-09-26 Darin Adler <darin@apple.com>
441 - refine charAt/charCodeAt fix slightly
443 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
444 omitted parameter, as we do everywhere else, and as other browsers do here.
446 2004-09-26 Darin Adler <darin@apple.com>
450 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
452 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
453 the program. We were doing this properly for functions, but not entire programs.
455 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
457 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
458 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
460 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
466 2004-09-14 Richard Williamson <rjw@apple.com>
468 1. Add class parameter to object allocation function. This is somewhat redundant, given that
469 the allocation function is in the class function vector, but people wanted to use the same
470 allocation function for different classes.
472 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
474 3. Add support for a default function on an object. This is a feature that ActiveX supports,
475 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
476 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
477 'Objective-C' bindings.
479 There bugs are covered by
481 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
482 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
483 <rdar://problem/3674754> Need to implement latest npruntime.h
487 * bindings/NP_jsobject.cpp:
491 * bindings/c/c_class.cpp:
492 * bindings/c/c_instance.cpp:
493 (CInstance::CInstance):
494 (CInstance::operator=):
495 (CInstance::invokeMethod):
496 (CInstance::invokeDefaultMethod):
497 * bindings/c/c_instance.h:
498 * bindings/c/c_runtime.cpp:
499 * bindings/c/c_runtime.h:
500 * bindings/jni/jni_instance.cpp:
501 (JavaInstance::invokeDefaultMethod):
502 * bindings/jni/jni_instance.h:
503 * bindings/npruntime.cpp:
505 * bindings/npruntime.h:
506 * bindings/objc/WebScriptObject.h:
507 * bindings/objc/objc_class.mm:
508 (ObjcClass::fallbackObject):
509 * bindings/objc/objc_instance.h:
510 * bindings/objc/objc_instance.mm:
511 (ObjcInstance::invokeDefaultMethod):
512 * bindings/objc/objc_runtime.h:
513 * bindings/objc/objc_runtime.mm:
514 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
515 (ObjcFallbackObjectImp::get):
516 (ObjcFallbackObjectImp::put):
517 (ObjcFallbackObjectImp::canPut):
518 (ObjcFallbackObjectImp::implementsCall):
519 (ObjcFallbackObjectImp::call):
520 (ObjcFallbackObjectImp::hasProperty):
521 (ObjcFallbackObjectImp::deleteProperty):
522 (ObjcFallbackObjectImp::defaultValue):
523 * bindings/runtime.h:
524 (KJS::Bindings::Class::fallbackObject):
525 (KJS::Bindings::Instance::getValueOfUndefinedField):
526 (KJS::Bindings::Instance::setValueOfUndefinedField):
527 (KJS::Bindings::Instance::valueOf):
528 * bindings/runtime_object.cpp:
529 (RuntimeObjectImp::implementsCall):
530 (RuntimeObjectImp::call):
531 * bindings/runtime_object.h:
533 2004-09-13 Maciej Stachowiak <mjs@apple.com>
537 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
539 * kjs/string_object.cpp:
540 (StringProtoFuncImp::call): Replaced implementation of replace()
541 method with function below...
542 (replace): In order to avoid excessive allocation and copying,
543 figure out the ranges of the original string and replacement
544 strings to be assembled, instead of constantly creating new
545 strings at each substitution. The old behavior is basically O(N^2)
546 for a global replace on a pattern that matches many places in the
548 (regExpIsGlobal): Helper function for the above.
549 (expandSourceRanges): ditto
550 (pushSourceRange): ditto
551 (expandReplacements): ditto
552 (pushReplacement): ditto
554 (KJS::UString::spliceSubstringsWithSeparators): New method that
555 pieces together substring ranges of this string together with
556 specified separators, all at one go.
558 (KJS::UString::Range::Range): Added new helper class to represent
561 2004-09-14 Maciej Stachowiak <mjs@apple.com>
565 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
568 (KJS::GlobalFuncImp::call): Make sure to escape null
569 characters. This is a bug in the new code that made part of the
572 2004-09-13 Darin Adler <darin@apple.com>
574 Reviewed by Kevin and Maciej.
576 - new function to support fix for DIG bug in WebCore
578 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
579 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
581 2004-09-12 Darin Adler <darin@apple.com>
583 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
584 of escape and unescape.
586 2004-09-12 Darin Adler <darin@apple.com>
590 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
592 * kjs/date_object.cpp:
593 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
594 uses CFDateFormatter.
595 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
597 2004-09-09 Maciej Stachowiak <mjs@apple.com>
601 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
604 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
605 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
607 (Lexer::isHexDigit): Made static and non-const.
612 2004-09-06 Darin Adler <darin@apple.com>
614 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
618 2004-09-01 Richard Williamson <rjw@apple.com>
620 Add pid to exception messages (to help debug dashboard clients).
624 * kjs/interpreter.cpp:
625 (Interpreter::evaluate):
629 2004-08-20 Richard Williamson <rjw@apple.com>
631 Implemented new JNI abstraction. We no longer invoke Java methods
632 directly with JNI, rather we call into the plugin. This allows the
633 plugin to dispatch the call to the appropriate VM thread. This
634 change should (will?) fix a whole class of threading related problems with
639 * JavaScriptCore.pbproj/project.pbxproj:
640 * bindings/c/c_instance.h:
641 (KJS::Bindings::CInstance::setExecutionContext):
642 (KJS::Bindings::CInstance::executionContext):
643 * bindings/jni/jni_instance.cpp:
644 (JavaInstance::JavaInstance):
645 (JavaInstance::invokeMethod):
646 (JavaInstance::setExecutionContext):
647 (JavaInstance::executionContext):
648 * bindings/jni/jni_instance.h:
649 * bindings/jni/jni_jsobject.cpp:
650 (JSObject::convertJObjectToValue):
651 * bindings/jni/jni_runtime.cpp:
652 (JavaField::JavaField):
653 (JavaArray::convertJObjectToArray):
654 (JavaField::valueFromInstance):
655 (JavaArray::JavaArray):
656 (JavaArray::valueAt):
657 * bindings/jni/jni_runtime.h:
658 (KJS::Bindings::JavaArray::operator=):
659 (KJS::Bindings::JavaArray::executionContext):
660 * bindings/jni/jni_utility.h:
661 * bindings/objc/objc_instance.h:
662 (KJS::Bindings::ObjcInstance::setExecutionContext):
663 (KJS::Bindings::ObjcInstance::executionContext):
664 * bindings/runtime.cpp:
665 (Instance::createBindingForLanguageInstance):
666 * bindings/runtime.h:
667 * bindings/runtime_root.h:
668 (KJS::Bindings::RootObject::nativeHandle):
672 2004-08-19 Vicki Murley <vicki@apple.com>
676 * kjs/property_map.cpp:
677 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
679 2004-08-17 Darin Adler <darin@apple.com>
683 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
685 * kjs/property_map.h: Added some private functions.
686 * kjs/property_map.cpp:
687 (KJS::PropertyMap::clear): Set sentinelCount to 0.
688 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
689 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
690 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
691 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
692 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
693 deleted-element sentinels.
694 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
696 2004-08-16 Maciej Stachowiak <mjs@apple.com>
698 Code change by Eric Albert, reviewd by me.
700 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
702 * kjs/date_object.cpp:
703 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
704 entirely would be even better, but is not required to fix this bug.
708 2004-08-16 Richard Williamson <rjw@apple.com>
710 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
712 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
716 * bindings/NP_jsobject.cpp:
718 * bindings/jni/jni_jsobject.cpp:
720 * bindings/objc/WebScriptObject.mm:
721 (-[WebScriptObject evaluateWebScript:]):
723 2004-08-15 Richard Williamson <rjw@apple.com>
725 More updates to np headers. Implemented new NPN functions.
729 * bindings/NP_jsobject.cpp:
733 * bindings/npruntime.h:
735 2004-08-13 Darin Adler <darin@apple.com>
737 - fix build so we can compile again
739 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
740 is good enough so that we can compile, but it's only a stopgap measure, because I think
741 Richard has a newer one he wants to check in.
743 2004-08-12 Richard Williamson <rjw@apple.com>
745 Bring npruntime.h and friends closer to compliance with
750 * JavaScriptCore.pbproj/project.pbxproj:
751 * bindings/NP_jsobject.cpp:
753 (_NPN_CreateScriptObject):
758 (NPN_RemoveProperty):
759 * bindings/NP_jsobject.h:
760 * bindings/c/c_instance.cpp:
761 (CInstance::invokeMethod):
762 * bindings/c/c_utility.cpp:
763 (convertNPVariantToValue):
764 * bindings/npruntime.cpp:
765 (NPN_IdentifierIsString):
768 (NPN_VariantIsUndefined):
770 (NPN_VariantIsInt32):
771 (NPN_VariantIsDouble):
772 (NPN_VariantIsString):
773 (NPN_VariantIsObject):
775 (NPN_VariantToString):
776 (NPN_VariantToInt32):
777 (NPN_VariantToDouble):
778 (NPN_VariantToObject):
779 (NPN_InitializeVariantAsVoid):
780 (NPN_InitializeVariantAsNull):
781 (NPN_InitializeVariantAsUndefined):
782 (NPN_InitializeVariantWithBool):
783 (NPN_InitializeVariantWithInt32):
784 (NPN_InitializeVariantWithDouble):
785 (NPN_InitializeVariantWithString):
786 (NPN_InitializeVariantWithStringCopy):
787 (NPN_InitializeVariantWithObject):
788 (NPN_InitializeVariantWithVariant):
789 (NPN_ReleaseVariantValue):
791 * bindings/npruntime.h:
793 (_NPString::_NPVariant::):
794 * bindings/npruntime_priv.h: Added.
796 2004-08-12 Darin Adler <darin@apple.com>
800 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
803 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
804 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
805 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
806 to skip leading "+" or "-".
810 2004-08-12 Darin Adler <darin@apple.com>
814 - fixed 43 Mozilla JavaScript tests
816 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
817 * kjs/date_object.cpp:
818 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
819 than constructing a number object to pass to it.
820 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
821 (KJS::parseDate): Change to return a double instead of creating the Number object here.
822 (KJS::timeClip): Implement this as specified in the language standard.
824 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
825 flags on the prototype property.
828 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
830 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
832 (KJS::parseDigit): Added. Helper function for parseInt.
833 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
834 strtoll can handle. Also matches standard more closely.
835 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
837 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
839 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
841 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
843 (Lexer::setCode): Clear error state.
844 (Lexer::lex): Set error state if the lexer encounters an error
847 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
848 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
850 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
851 Change round to round values between -0.5 and -0 to -0 instead of +0.
853 * kjs/nodes.h: Add evaluateReference function to GroupNode.
854 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
855 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
856 would change x.y into a value that can't be deleted as a side effect.
858 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
861 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
862 get rid of the fixed size limit for code.
864 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
865 returns the string without creating a new Rep, since I'm using substr in a place where it will
868 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
869 the other day that was making a couple tests fail.
870 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
871 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
872 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
873 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
874 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
876 * kjs/string_object.lut.h: Regenerated.
878 2004-08-11 Darin Adler <darin@apple.com>
880 - fixed a tiny problem with the UTF-16 PCRE check-in
882 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
883 the ctype_meta flag to get set in items that should not have it.
885 * pcre/chartables.c: Regenerated.
887 2004-08-10 Richard Williamson <rjw@apple.com>
889 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
891 The following WebScripting methods are now supported on bound
894 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
895 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
896 - (id)valueForUndefinedKey:(NSString *)key
900 * bindings/c/c_class.cpp:
901 (CClass::fieldNamed):
902 * bindings/c/c_class.h:
903 * bindings/jni/jni_class.cpp:
904 (JavaClass::fieldNamed):
905 * bindings/jni/jni_class.h:
906 * bindings/objc/objc_class.h:
907 (KJS::Bindings::ObjcClass::isa):
908 * bindings/objc/objc_class.mm:
909 (ObjcClass::methodsNamed):
910 (ObjcClass::fieldNamed):
911 (ObjcClass::fallbackObject):
912 * bindings/objc/objc_instance.h:
913 * bindings/objc/objc_instance.mm:
914 (ObjcInstance::invokeMethod):
915 (ObjcInstance::setValueOfField):
916 (ObjcInstance::setValueOfUndefinedField):
917 (ObjcInstance::getValueOfField):
918 (ObjcInstance::getValueOfUndefinedField):
919 * bindings/objc/objc_runtime.h:
920 (KJS::Bindings::ObjcField::~ObjcField):
921 (KJS::Bindings::ObjcField::ObjcField):
922 (KJS::Bindings::ObjcField::operator=):
923 (KJS::Bindings::FallbackObjectImp::classInfo):
924 * bindings/objc/objc_runtime.mm:
925 (ObjcField::ObjcField):
928 (ObjcField::valueFromInstance):
929 (ObjcField::setValueToInstance):
930 (FallbackObjectImp::FallbackObjectImp):
931 (FallbackObjectImp::get):
932 (FallbackObjectImp::put):
933 (FallbackObjectImp::canPut):
934 (FallbackObjectImp::implementsCall):
935 (FallbackObjectImp::call):
936 (FallbackObjectImp::hasProperty):
937 (FallbackObjectImp::deleteProperty):
938 (FallbackObjectImp::defaultValue):
939 * bindings/runtime.h:
940 (KJS::Bindings::Class::fallbackObject):
941 (KJS::Bindings::Instance::getValueOfUndefinedField):
942 (KJS::Bindings::Instance::setValueOfUndefinedField):
943 * bindings/runtime_object.cpp:
944 (RuntimeObjectImp::get):
945 (RuntimeObjectImp::put):
946 (RuntimeObjectImp::canPut):
947 (RuntimeObjectImp::hasProperty):
948 * bindings/testbindings.mm:
949 (-[MyFirstInterface valueForUndefinedKey:]):
950 (-[MyFirstInterface setValue:forUndefinedKey:]):
952 2004-08-10 Darin Adler <darin@apple.com>
956 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
958 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
959 or uint16_t depending on the mode, and used appropriate in the 7 public functions
961 * pcre/pcre.c: Add UTF-16 support to all functions.
962 * pcre/study.c: Ditto.
964 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
965 the mode. Changed declarations to use symbolic constants and typedefs so we size
966 things to ichar when needed.
968 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
969 sized to 16-bit characters instead of 8-bit.
972 (pcre_copy_substring): Use pcre_char instead of char.
973 (pcre_get_substring_list): Ditto.
974 (pcre_free_substring_list): Ditto.
975 (pcre_get_substring): Ditto.
976 (pcre_free_substring): Ditto.
978 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
979 of hard-coding 8-bit table sizes.
981 * pcre/chartables.c: Regenerated.
983 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
984 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
985 is not null. The null string still has a null pointer. This prevents us from
986 passing a null through to the regular expression engine (which results in a null
987 error even when the string length is 0).
990 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
991 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
993 2004-08-09 Darin Adler <darin@apple.com>
997 - fixed 28 Mozilla JavaScript tests
999 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1000 checking the number of arguments for the join method.
1002 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1003 than integers, so we aren't limited to 32 bits.
1005 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1006 the implementation of the pow operation. Also simplied a case that was handling positive
1007 and negative infinity separately.
1009 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1010 putting them in a long, so that unsigned shift will work properly.
1012 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1014 * kjs/operations.cpp:
1015 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1016 sign of isinf; our isinf function returns +1 even for negative infinity.
1017 (KJS::isNegInf): And again.
1018 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1019 Our floating point already handles the various infinity cases correctly.
1021 * kjs/regexp_object.cpp:
1022 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1023 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1024 array in cases where we did not match.
1025 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1026 "global", "ignoreCase", "multiline", and "source".
1028 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1029 string into undefined rather than an empty string. For the slice method, handle an
1030 undefined parameter for the limit properly as decribed in the specification, and add
1031 the limit to one case that didn't have the limit at all. For the methods that generate
1032 HTML strings, use lowercase tags instead of uppercase.
1035 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1036 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1037 (KJS::UString::append): Fix some math that caused a buffer overflow.
1038 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1039 flag) rather than converting them all to 0.
1040 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1042 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1044 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1045 the Unicode specification in a few cases where it was wrong before.
1046 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1047 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1048 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1049 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1050 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1051 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1052 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1053 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1054 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1056 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1058 * kjs/number_object.lut.h: Regenerated.
1060 2004-08-09 Darin Adler <darin@apple.com>
1064 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1066 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1067 we get a buffer overflow.
1071 2004-08-05 Richard Williamson <rjw@apple.com>
1073 Fixed part of 3674747. The QT guys need this for feature freeze.
1075 This patch implements support for the
1077 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1079 method of objects bound to JavaScript.
1084 * bindings/objc/objc_class.mm:
1085 (ObjcClass::methodsNamed):
1086 (ObjcClass::fieldNamed):
1087 * bindings/objc/objc_instance.mm:
1088 (ObjcInstance::invokeMethod):
1089 * bindings/objc/objc_runtime.h:
1090 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1091 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1092 (KJS::Bindings::ObjcMethod::javaScriptName):
1093 * bindings/objc/objc_runtime.mm:
1094 (ObjcMethod::ObjcMethod):
1095 (ObjcMethod::getMethodSignature):
1096 (ObjcMethod::setJavaScriptName):
1097 * bindings/testbindings.mm:
1099 2004-08-04 Vicki Murley <vicki@apple.com>
1103 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1106 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1107 go to the next line and continue parsing the string (instead of failing). This matches
1108 behavior in Mac IE and Mozilla.
1110 2004-08-03 Kevin Decker <kdecker@apple.com>
1114 Rolled in changes from the latest KJS sources that support additional
1115 Number.prototype functions.
1117 Specifically this patch covers the follow parts of the ECMA 3 spec:
1118 15.7.4.5, 15.7.4.6, and 15.7.4.7
1121 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1122 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1123 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1125 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1126 list of supported identifiers (a macro).
1127 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1128 and toExponential().
1129 (NumberPrototypeImp::NumberPrototypeImp):
1130 (NumberProtoFuncImp::call):
1131 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1133 (KJS::NumberProtoFuncImp::):
1134 * tests/mozilla/expected.html: Update results.
1136 2004-08-03 Darin Adler <darin@apple.com>
1140 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1142 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1143 we are supposed to just copy the regular expression object, and do so.
1144 Also tighten up arguments check to handle case where an actual "undefined"
1145 is passed rather than just omitting an argument.
1147 * tests/mozilla/expected.html: Update results.
1149 2004-08-02 Darin Adler <darin@apple.com>
1151 * tests/mozilla/.cvsignore: Added.
1152 * tests/mozilla/expected.html: Update results.
1154 2004-08-02 Darin Adler <darin@apple.com>
1158 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1160 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1161 Append the flags here so more tests paseed.
1163 2004-08-02 Darin Adler <darin@apple.com>
1167 - fixed a couple things making 5 Mozilla regexp tests pass
1169 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1171 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1172 be used as the flags string when no parameter was passed.
1174 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1175 Added a class info object for RegExp prototype so it can return
1176 a string instead of raising an exception when converting to a string.
1178 * tests/mozilla/expected.html: Update results.
1180 2004-08-02 Darin Adler <darin@apple.com>
1184 - fix crashes in mozilla tests due to mishandling NaN
1186 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1187 calls to toInteger so that NaN will get turned into something that fits in an integer.
1188 These were the ones John already fixed, but his fix used isnan and the new fix is
1191 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1192 after a call to toInteger to handle NaN properly. Also removed separate check
1193 for undefined that's not needed.
1195 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1196 as in the above two files, but for a lot more functions. Also changed one place with
1197 an explicit check for undefined to instead just check isNaN.
1199 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1200 like me who don't keep $SYMROOTS in their $PATH.
1206 2004-07-26 Kevin Decker <kdecker@apple.com>
1208 Changes done by Darin, reviewed by Kevin.
1210 - changed testkjs to build in Xcode rather than from Makefile
1212 * .cvsignore: Removed obsolete files from this list.
1213 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1214 Changed to build target "All" rather than default target. This makes us
1215 build the testkjs test tool.
1216 * dummy.cpp: Removed.
1217 * kjs/.cvsignore: Removed obsolete files from this list, including
1218 the testkjs tool, which is now built in the symroots directory.
1219 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1220 changed this file. Also this has the nice side effect of causing the tool
1221 to be rebuilt in the new location even if there are no other changes in
1222 your tree when you check this out.
1223 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1224 without setting the execute bit on jsDriver.pl.
1226 2004-07-22 Kevin Decker <kdecker@apple.com>
1230 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1232 * kjs/function_object.cpp:
1233 (FunctionObjectImp::construct):
1234 * kjs/function_object.h:
1236 (KJS::ObjectImp::construct):
1238 (KJS::Object::construct):
1240 2004-07-21 Darin Adler <darin@apple.com>
1242 * bindings/npruntime.h: Fixed typo.
1244 2004-07-19 John Sullivan <sullivan@apple.com>
1248 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1249 vulnerability in my patch for 3714644
1251 * kjs/array_object.cpp:
1252 (ArrayProtoFuncImp::call):
1253 handle NAN parameters passed to slice() by clamping to 0 and length.
1255 2004-07-19 Richard Williamson <rjw@apple.com>
1257 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1262 * bindings/jni/jni_jsobject.cpp:
1264 (JSObject::JSObject):
1266 2004-07-16 John Sullivan <sullivan@apple.com>
1270 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1271 hangs browser with javascript
1273 * kjs/array_object.cpp:
1274 (ArrayProtoFuncImp::call):
1275 Check for undefined type for args[0] the same way we were already checking
1276 for args[1]. In this case, args was zero-length, but we were treating
1277 args[0] like an integer anyway. Resulted in some code looping from a NAN
1278 value to 4, taking approximately forever.
1280 * JavaScriptCore.pbproj/project.pbxproj:
1285 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1289 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1290 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1292 * kjs/number_object.cpp:
1293 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1295 2004-07-13 Kevin Decker <kdecker@apple.com>
1297 Reviewed by kocienda.
1299 - made testkjs and JavaScriptCore a subtarget of 'All'
1300 - testkjs now builds in $SYMROOTS
1302 * JavaScriptCore.pbproj/project.pbxproj:
1306 2004-06-24 Chris Blumenberg <cblu@apple.com>
1308 Ignore .mode1 files in JavaScriptCore.pbproj
1310 Reviewed by kocienda.
1312 * JavaScriptCore.pbproj/.cvsignore:
1314 2004-06-23 Richard Williamson <rjw@apple.com>
1316 Implemented changes for latest npruntime.h.
1320 * JavaScriptCore.pbproj/project.pbxproj:
1321 * bindings/NP_jsobject.cpp:
1322 (listFromVariantArgs):
1323 (identiferFromNPIdentifier):
1324 (_NPN_CreateScriptObject):
1329 (NPN_RemoveProperty):
1330 * bindings/NP_jsobject.h:
1331 * bindings/c/c_class.cpp:
1332 (CClass::methodsNamed):
1333 (CClass::fieldNamed):
1334 * bindings/c/c_instance.cpp:
1335 (CInstance::invokeMethod):
1336 * bindings/c/c_utility.cpp:
1337 (convertNPVariantToValue):
1338 * bindings/c/c_utility.h:
1339 * bindings/npruntime.cpp:
1340 (stringIdentifierEqual):
1341 (stringIdentifierHash):
1342 (getStringIdentifierDictionary):
1343 (intIdentifierEqual):
1344 (intIdentifierHash):
1345 (getIntIdentifierDictionary):
1346 (NPN_GetStringIdentifier):
1347 (NPN_GetStringIdentifiers):
1348 (NPN_GetIntIdentifier):
1349 (NPN_IdentifierIsString):
1350 (NPN_UTF8FromIdentifier):
1351 (NPN_VariantToInt32):
1352 (NPN_VariantToDouble):
1354 * bindings/npruntime.h:
1355 * bindings/objc/WebScriptObject.mm:
1356 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1357 * bindings/runtime_object.cpp:
1358 (RuntimeObjectImp::~RuntimeObjectImp):
1359 * bindings/runtime_root.cpp:
1360 (KJS::Bindings::rootForInterpreter):
1361 * bindings/testbindings.cpp:
1362 (initializeIdentifiers):
1368 === JavaScriptCore-146.1 ===
1370 2004-06-16 Richard Williamson <rjw@apple.com>
1372 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1374 This turned out to be a show stopper for Dashboard. Accessing a nil
1375 ObjC property from JS caused a crash. Similar to the problem
1376 3696112 fixed below.
1380 * bindings/objc/objc_runtime.mm:
1381 (KJS::Bindings::ObjcField::valueFromInstance):
1385 2004-06-16 Richard Williamson <rjw@apple.com>
1387 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1389 This turned out to be a show stopper for Dashboard. We now
1390 return Undefined() when nil is returned from a ObjC method
1391 that returns an object type.
1395 * bindings/objc/objc_utility.mm:
1396 (KJS::Bindings::convertObjcValueToValue):
1400 2004-06-15 Richard Williamson <rjw@apple.com>
1402 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1404 No longer need to check respondsToSelector: for
1405 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1406 because these now have a default implementation on NSObject.
1410 * bindings/objc/objc_class.mm:
1411 (ObjcClass::methodsNamed):
1412 (ObjcClass::fieldNamed):
1414 2004-06-14 Darin Adler <darin@apple.com>
1418 - fixed some things for GC that Patrick missed, or that happened after the branch
1420 * bindings/objc/WebScriptObject.mm:
1421 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1422 (-[WebScriptObject finalize]): Added.
1424 - added some missing nil checks
1426 * bindings/objc/objc_instance.mm:
1427 (ObjcInstance::ObjcInstance): Check for nil.
1428 (ObjcInstance::~ObjcInstance): Check for nil.
1429 (ObjcInstance::operator=): Check for nil.
1431 2004-06-14 Darin Adler <darin@apple.com>
1433 Reviewed by me, code changes by Patrick Beard.
1435 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1437 * bindings/objc/objc_instance.mm:
1438 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1439 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1440 (ObjcInstance::operator=): More of the same.
1441 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1443 * bindings/objc/objc_runtime.mm:
1444 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1445 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1446 (ObjcArray::operator=): More of the same.
1448 * bindings/testbindings.mm: Fixed incorrect license.
1449 (main): Use [pool drain] if compiling on Tiger.
1453 2004-06-10 Kevin Decker <kdecker@apple.com>
1459 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1461 (KJS::Lexer::lineNo):
1462 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1464 === JavaScriptCore-143.2 ===
1466 2004-06-07 Darin Adler <darin@apple.com>
1468 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1470 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1471 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1473 === JavaScriptCore-143.1 ===
1475 2004-06-04 Kevin Decker <kdecker@apple.com>
1479 - fixed <rdar://problem/3680594>
1482 (KJS::Error::create):
1486 2004-06-04 Darin Adler <darin@apple.com>
1488 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1490 2004-06-04 Kevin Decker <kdecker@apple.com>
1494 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1495 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1496 - changed the wording of an error message
1497 - the lexer, parser, and interpreter have been made "sourceURL aware"
1498 - stored the url into Error
1500 * bindings/NP_jsobject.cpp:
1502 * bindings/jni/jni_jsobject.cpp:
1504 * bindings/objc/WebScriptObject.mm:
1505 (-[WebScriptObject evaluateWebScript:]):
1507 (GlobalFuncImp::call):
1508 * kjs/function_object.cpp:
1509 (FunctionObjectImp::construct):
1512 (InterpreterImp::checkSyntax):
1513 (InterpreterImp::evaluate):
1515 * kjs/interpreter.cpp:
1516 (Interpreter::evaluate):
1517 * kjs/interpreter.h:
1521 (KJS::Lexer::sourceURL):
1525 (FunctionCallNode::evaluate):
1528 (KJS::Error::create):
1531 2004-06-04 Richard Williamson <rjw@apple.com>
1533 Fixed crash when attempting to access properties on nil
1538 * bindings/objc/objc_instance.mm:
1539 (ObjcInstance::getClass):
1540 * bindings/runtime_object.cpp:
1541 (RuntimeObjectImp::get):
1542 * bindings/testM.js:
1543 * bindings/testbindings.mm:
1544 (-[MyFirstInterface getString]):
1546 2004-05-27 Kevin Decker <kdecker@apple.com>
1550 -revised generated error message content
1552 * kjs/error_object.cpp:
1553 (ErrorProtoFuncImp::call):
1557 (KJS::Error::create):
1561 2004-05-27 Richard Williamson <rjw@apple.com>
1563 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
1567 * bindings/objc/WebScriptObject.h:
1569 2004-05-27 Darin Adler <darin@apple.com>
1573 - moved to new symlink technique for embedding frameworks
1575 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
1576 because we don't need it any more.
1578 2004-05-24 Richard Williamson <rjw@apple.com>
1580 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
1581 fixed ClassInfo to correctly reflect inheritance. This is required
1582 because of the runtime checks in JSC for arrays, i.e. in
1583 the Function objects apply method.
1587 * bindings/jni/jni_runtime.cpp:
1588 (JavaArray::convertJObjectToArray):
1589 * bindings/objc/objc_utility.mm:
1590 (KJS::Bindings::convertObjcValueToValue):
1591 * bindings/runtime_array.cpp:
1592 (RuntimeArrayImp::RuntimeArrayImp):
1593 * bindings/runtime_array.h:
1594 * bindings/testM.js: Added.
1595 * bindings/testbindings.mm:
1596 (+[MyFirstInterface webScriptNameForSelector:]):
1597 (-[MyFirstInterface logMessages:]):
1598 (-[MyFirstInterface logMessage:prefix:]):
1599 (-[MyFirstInterface callJSObject::]):
1601 2004-05-22 Darin Adler <darin@apple.com>
1605 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
1607 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
1608 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
1609 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
1610 it hasn't been set explicitly.
1614 2004-05-20 Richard Williamson <rjw@apple.com>
1616 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
1617 can now be referenced like any other WebScriptObject, meaning
1618 you can do JS operations on them.
1620 All added implementation of finalizeForWebScript.
1624 * bindings/objc/WebScriptObject.h:
1625 * bindings/objc/WebScriptObject.mm:
1626 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
1627 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1628 (-[WebScriptObject KJS::]):
1629 (-[WebScriptObject dealloc]):
1630 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1631 (-[WebScriptObject evaluateWebScript:]):
1632 (-[WebScriptObject setValue:forKey:]):
1633 (-[WebScriptObject valueForKey:]):
1634 (-[WebScriptObject stringRepresentation]):
1635 * bindings/objc/WebScriptObjectPrivate.h:
1636 * bindings/objc/objc_instance.mm:
1637 (ObjcInstance::~ObjcInstance):
1639 2004-05-19 Richard Williamson <rjw@apple.com>
1641 Removed extraneous tabs that were added (by XCode?).
1643 * bindings/objc/WebScriptObject.h:
1645 2004-05-19 Darin Adler <darin@apple.com>
1647 - fixed headers with licenses mangled by Xcode auto-indenting
1649 * bindings/jni/jni_jsobject.cpp:
1650 * bindings/jni/jni_jsobject.h:
1651 * bindings/runtime_array.h:
1652 * bindings/runtime_root.cpp:
1653 * bindings/runtime_root.h:
1655 2004-05-18 Richard Williamson <rjw@apple.com>
1657 Added exception logging. Also check for exception and
1658 set results as appropriate.
1660 Reviewed by Maciej (partially reviewed).
1662 * bindings/objc/WebScriptObject.mm:
1663 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1664 (-[WebScriptObject evaluateWebScript:]):
1665 (-[WebScriptObject setValue:forKey:]):
1666 (-[WebScriptObject valueForKey:]):
1668 2004-05-18 Richard Williamson <rjw@apple.com>
1670 Finsished implementing support for windowScriptObject.
1671 Had to make WebScriptObjectPrivate.h accessible from
1676 * JavaScriptCore.pbproj/project.pbxproj:
1677 * bindings/objc/WebScriptObjectPrivate.h:
1679 2004-05-18 Richard Williamson <rjw@apple.com>
1681 Use KVC to set/get values instead of directly accessing
1686 * bindings/objc/WebScriptObject.mm:
1687 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1688 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1689 * bindings/objc/objc_runtime.mm:
1690 (ObjcField::valueFromInstance):
1691 (convertValueToObjcObject):
1692 (ObjcField::setValueToInstance):
1694 2004-05-17 Richard Williamson <rjw@apple.com>
1696 Implemented new API for WebScriptObject.
1698 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
1699 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
1703 * JavaScriptCore.pbproj/project.pbxproj:
1704 * bindings/c/c_instance.cpp:
1705 (CInstance::invokeMethod):
1706 * bindings/jni/jni_instance.cpp:
1707 (JavaInstance::invokeMethod):
1708 * bindings/jni/jni_jsobject.cpp:
1709 (JSObject::convertValueToJObject):
1710 * bindings/jni/jni_utility.cpp:
1711 (KJS::Bindings::getJNIField):
1712 * bindings/objc/WebScriptObject.mm:
1714 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1715 (-[WebScriptObject KJS::]):
1716 (-[WebScriptObject dealloc]):
1717 (+[WebScriptObject throwException:]):
1719 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1720 (-[WebScriptObject evaluateWebScript:]):
1721 (-[WebScriptObject setValue:forKey:]):
1722 (-[WebScriptObject valueForKey:]):
1723 (-[WebScriptObject stringRepresentation]):
1724 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1725 (+[WebUndefined undefined]):
1726 (-[WebUndefined initWithCoder:]):
1727 (-[WebUndefined encodeWithCoder:]):
1728 (-[WebUndefined copyWithZone:]):
1729 (-[WebUndefined retain]):
1730 (-[WebUndefined release]):
1731 (-[WebUndefined retainCount]):
1732 (-[WebUndefined autorelease]):
1733 (-[WebUndefined dealloc]):
1734 (-[WebUndefined copy]):
1735 (-[WebUndefined replacementObjectForPortCoder:]):
1736 * bindings/objc/WebScriptObjectPrivate.h: Added.
1737 * bindings/objc/objc_class.mm:
1738 (ObjcClass::methodsNamed):
1739 (ObjcClass::fieldNamed):
1740 * bindings/objc/objc_instance.mm:
1741 (ObjcInstance::invokeMethod):
1742 * bindings/objc/objc_jsobject.h:
1743 * bindings/objc/objc_jsobject.mm:
1744 * bindings/objc/objc_runtime.mm:
1745 (ObjcField::valueFromInstance):
1746 * bindings/objc/objc_utility.mm:
1747 (KJS::Bindings::JSMethodNameToObjCMethodName):
1748 (KJS::Bindings::convertValueToObjcValue):
1749 (KJS::Bindings::convertObjcValueToValue):
1750 * bindings/runtime.cpp:
1751 (Instance::setDidExecuteFunction):
1752 (Instance::didExecuteFunction):
1753 (Instance::setValueOfField):
1754 * bindings/runtime.h:
1755 * bindings/testbindings.mm:
1756 (+[MyFirstInterface webScriptNameForSelector:]):
1757 (-[MyFirstInterface callJSObject::]):
1759 2004-05-14 Vicki Murley <vicki@apple.com>
1763 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
1765 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
1769 2004-05-13 Richard Williamson <rjw@apple.com>
1776 * bindings/objc/WebScriptObject.h:
1778 2004-05-13 Richard Williamson <rjw@apple.com>
1780 Approved API changes. Currently unimplemented.
1785 * JavaScriptCore.pbproj/project.pbxproj:
1786 * bindings/objc/WebScriptObject.h: Added.
1787 * bindings/objc/WebScriptObject.mm: Added.
1788 (+[WebScriptObject throwException:]):
1789 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1790 (-[WebScriptObject evaluateWebScript:]):
1791 (-[WebScriptObject stringRepresentation]):
1792 (+[WebUndefined undefined]):
1793 (-[WebUndefined initWithCoder:]):
1794 (-[WebUndefined encodeWithCoder:]):
1795 (-[WebUndefined copyWithZone:]):
1797 2004-05-07 Vicki Murley <vicki@apple.com>
1801 Turn off GC since it uses ppc only instructions (which breaks
1804 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
1808 2004-05-07 Maciej Stachowiak <mjs@apple.com>
1812 - add -funroll-loops=16 compiler option for approx .5% speedup on
1813 HTML iBench and .5-1% speedup on JS iBench.
1815 * JavaScriptCore.pbproj/project.pbxproj:
1817 2004-04-25 Maciej Stachowiak <mjs@apple.com>
1821 Enable full conservative GC mode in addition to test mode. When
1822 conservative GC is enabled, we now get an 11% speed improvement on
1823 the iBench. Also fix some spots I missed before.
1825 Specific noteworth changes:
1827 * kjs/collector.cpp:
1828 (KJS::Collector::markStackObjectsConservatively): Check possible
1829 cell pointers for 8-byte aligment and verify they are not 0.
1831 * kjs/protected_values.cpp:
1832 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
1833 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
1835 (KJS::gcProtectNullTolerant): ...to here...
1836 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
1837 tolerance, and doing the check is expensive.
1839 * kjs/protected_values.cpp:
1840 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
1841 that is still very good.
1846 (KJS::ProtectedValue::ProtectedValue):
1847 (KJS::ProtectedValue::~ProtectedValue):
1848 (KJS::ProtectedValue::operator=):
1849 (KJS::ProtectedObject::ProtectedObject):
1850 (KJS::ProtectedObject::~ProtectedObject):
1851 (KJS::ProtectedObject::operator=):
1852 (KJS::ProtectedReference::ProtectedReference):
1853 (KJS::ProtectedReference::~ProtectedReference):
1854 (KJS::ProtectedReference::operator=):
1855 * kjs/protected_values.cpp:
1856 (KJS::ProtectedValues::getProtectCount):
1857 (KJS::ProtectedValues::increaseProtectCount):
1858 (KJS::ProtectedValues::decreaseProtectCount):
1859 (KJS::ProtectedValues::computeHash):
1860 * bindings/runtime_root.cpp:
1861 (KJS::Bindings::addNativeReference):
1862 (KJS::Bindings::removeNativeReference):
1863 (RootObject::removeAllNativeReferences):
1864 * bindings/runtime_root.h:
1865 (KJS::Bindings::RootObject::~RootObject):
1866 (KJS::Bindings::RootObject::setRootObjectImp):
1867 * kjs/collector.cpp:
1868 (KJS::Collector::allocate):
1869 (KJS::Collector::collect):
1872 (NumberImp::create):
1873 (InterpreterImp::globalInit):
1874 (InterpreterImp::globalClear):
1875 (InterpreterImp::mark):
1877 (KJS::List::derefValues):
1878 (KJS::List::refValues):
1879 (KJS::List::append):
1881 (KJS::ObjectImp::setInternalValue):
1882 (KJS::ObjectImp::putDirect):
1887 (KJS::ValueImp::ValueImp):
1888 (KJS::ValueImp::~ValueImp):
1890 (KJS::Value::Value):
1891 (KJS::Value::~Value):
1892 (KJS::Value::operator=):
1894 2004-04-30 Richard Williamson <rjw@apple.com>
1896 Asking an NSInvocation for it's return value when return type
1897 is void throws an exception. Added check for void return types
1898 to avoid this exception.
1902 * bindings/objc/objc_instance.mm:
1903 (ObjcInstance::invokeMethod):
1905 2004-04-29 Richard Williamson <rjw@apple.com>
1907 Fixed several bad problems with the ObjC bindings. In particular, conversion
1908 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
1912 * bindings/objc/objc_jsobject.h:
1913 * bindings/objc/objc_jsobject.mm:
1914 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
1915 (-[JavaScriptObject KJS::]):
1916 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1917 (-[JavaScriptObject call:arguments:]):
1918 (-[JavaScriptObject evaluate:]):
1919 (-[JavaScriptObject getMember:]):
1920 (-[JavaScriptObject getSlot:]):
1921 * bindings/objc/objc_runtime.mm:
1922 (ObjcField::valueFromInstance):
1923 (ObjcField::setValueToInstance):
1924 * bindings/objc/objc_utility.mm:
1925 (KJS::Bindings::convertValueToObjcValue):
1926 (KJS::Bindings::convertObjcValueToValue):
1927 * bindings/runtime.h:
1928 * bindings/runtime_root.cpp:
1929 (KJS::Bindings::rootForInterpreter):
1930 (KJS::Bindings::addNativeReference):
1931 (KJS::Bindings::removeNativeReference):
1932 * bindings/runtime_root.h:
1933 * bindings/testbindings.mm:
1934 (-[MyFirstInterface logMessage:]):
1935 (-[MyFirstInterface setJSObject:]):
1936 (-[MyFirstInterface callJSObject::]):
1938 2004-04-24 Darin Adler <darin@apple.com>
1942 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
1945 2004-04-23 Maciej Stachowiak <mjs@apple.com>
1949 Implementation of conservative GC, based partly on code from
1950 Darin. It's turned off for now, so it shouldn't have any effect on
1953 * JavaScriptCore.pbproj/project.pbxproj:
1954 * kjs/collector.cpp:
1955 (KJS::Collector::markStackObjectsConservatively):
1956 (KJS::Collector::markProtectedObjects):
1957 (KJS::Collector::collect):
1962 * kjs/protected_values.cpp: Added.
1963 (KJS::ProtectedValues::getProtectCount):
1964 (KJS::ProtectedValues::increaseProtectCount):
1965 (KJS::ProtectedValues::insert):
1966 (KJS::ProtectedValues::decreaseProtectCount):
1967 (KJS::ProtectedValues::expand):
1968 (KJS::ProtectedValues::shrink):
1969 (KJS::ProtectedValues::rehash):
1970 (KJS::ProtectedValues::computeHash):
1971 * kjs/protected_values.h: Added.
1973 (ValueImp::useConservativeMark):
1981 2004-04-22 Richard Williamson <rjw@apple.com>
1983 Fixed build snafu (re-declaration of NPBool in npruntime.h and
1986 * bindings/npruntime.h:
1988 2004-04-22 Richard Williamson <rjw@apple.com>
1990 Updated plugin binding API to reflect latest revision from
1993 Biggest change is the introduction of NPVariant used to represent
1994 value types. NPVariant replaces the use of NPObject for the
1995 exchange of values between scripting environment and native code.
1999 * JavaScriptCore.pbproj/project.pbxproj:
2000 * bindings/NP_jsobject.cpp:
2001 (identiferFromNPIdentifier):
2007 (NPN_GetPropertyAtIndex):
2008 (NPN_SetPropertyAtIndex):
2009 * bindings/c/c_class.cpp:
2010 (CClass::methodsNamed):
2011 (CClass::fieldNamed):
2012 * bindings/c/c_instance.cpp:
2013 (CInstance::invokeMethod):
2014 (CInstance::defaultValue):
2015 * bindings/c/c_runtime.cpp:
2016 (CField::valueFromInstance):
2017 (CField::setValueToInstance):
2018 * bindings/c/c_utility.cpp:
2019 (convertNPStringToUTF16):
2020 (convertUTF8ToUTF16):
2021 (coerceValueToNPVariantStringType):
2022 (convertValueToNPVariant):
2023 (convertNPVariantToValue):
2024 * bindings/c/c_utility.h:
2025 * bindings/npruntime.cpp:
2026 (NPN_GetIdentifier):
2027 (NPN_GetIdentifiers):
2028 (NPN_UTF8FromIdentifier):
2029 (NPN_VariantIsVoid):
2030 (NPN_VariantIsNull):
2031 (NPN_VariantIsUndefined):
2032 (NPN_VariantIsBool):
2033 (NPN_VariantIsInt32):
2034 (NPN_VariantIsDouble):
2035 (NPN_VariantIsString):
2036 (NPN_VariantIsObject):
2037 (NPN_VariantToBool):
2038 (NPN_VariantToString):
2039 (NPN_VariantToInt32):
2040 (NPN_VariantToDouble):
2041 (NPN_VariantToObject):
2042 (NPN_InitializeVariantAsVoid):
2043 (NPN_InitializeVariantAsNull):
2044 (NPN_InitializeVariantAsUndefined):
2045 (NPN_InitializeVariantWithBool):
2046 (NPN_InitializeVariantWithInt32):
2047 (NPN_InitializeVariantWithDouble):
2048 (NPN_InitializeVariantWithString):
2049 (NPN_InitializeVariantWithStringCopy):
2050 (NPN_InitializeVariantWithObject):
2051 (NPN_InitializeVariantWithVariant):
2052 (NPN_ReleaseVariantValue):
2055 (NPN_ReleaseObject):
2056 (NPN_IsKindOfClass):
2057 (NPN_SetExceptionWithUTF8):
2059 * bindings/npruntime.h:
2061 (_NPString::_NPVariant::):
2062 * bindings/testbindings.cpp:
2077 2004-04-22 Darin Adler <darin@apple.com>
2081 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2084 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2085 Was resulting in a buffer 2x the needed size.
2086 (KJS::UString::expandPreCapacity): Ditto.
2087 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2089 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2093 Preliminary change for conservative GC. Create "protected"
2094 subclasses to GC-protect objects when on heap, since we will soon
2095 remove the built-in refcounting of the normal wrapper classes. Use
2098 * JavaScriptCore.pbproj/project.pbxproj:
2101 (KJS::InterpreterImp::globalObject):
2102 * kjs/interpreter.h:
2103 * kjs/property_map.cpp:
2105 * kjs/reference_list.cpp:
2107 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2111 Optimize prepend using the shared substring optimization. Also,
2112 limit the applicability of shared append and shared prepend. If
2113 you overdo it, it does more harm than good, because you create a
2114 bunch of strings that are disqualified from future shared
2115 append/prepend, for not much immediate savings in allocate/copy
2120 (KJS::UString::Rep::create):
2121 (KJS::UString::expandedSize):
2122 (KJS::UString::usedPreCapacity):
2123 (KJS::UString::expandCapacity):
2124 (KJS::UString::expandPreCapacity):
2125 (KJS::UString::UString):
2126 (KJS::UString::append):
2127 (KJS::UString::operator=):
2129 (KJS::UString::Rep::data):
2131 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2132 Reviewed by Richard.
2134 No more need for Completion or Reference to privately inherit from
2135 Value, none of the superclass functionality is used.
2142 2004-04-16 Richard Williamson <rjw@apple.com>
2144 Added interpreter lock protection around object creation.
2148 * bindings/runtime.cpp:
2149 (Instance::createRuntimeObject):
2151 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2155 Another JavaScript speed improvement: use the mechanism from
2156 string append optimization to make taking a substring fast, again
2159 A further 22% improvement on the 24fun string speed test.
2163 (KJS::UString::Rep::create):
2164 (KJS::UString::UString):
2165 (KJS::UString::append):
2166 (KJS::UString::operator=):
2167 (KJS::UString::substr):
2169 (KJS::UString::Rep::data):
2171 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2175 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2176 - fixed <rdar://problem/3600691>: Table generation test is really slow
2177 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2179 80% speedup on the string test, lesser speedups on the other two.
2181 Two different optimizations here:
2183 1) Avoid large overhead of scanning strings to see if they are all
2184 ASCII before numeric conversion.
2187 (AssignNode::evaluate): Don't convert to integer until we know for
2188 sure the operation will need it. Attempting to convert strings to
2189 numbers is a waste when they are being appended with +=.
2191 2) Avoid huge cost of appending strings.
2193 This is done by allowing multiple strings to share a buffer but
2194 actually use different ranges of it. The first time a string is
2195 appended to, we start leaving at least 10% extra space in the
2196 buffer, so doing N appends to the same string takes O(log N)
2197 mallocs instead of O(N).
2199 * kjs/identifier.cpp:
2200 (KJS::Identifier::equal):
2201 (KJS::Identifier::add):
2204 (KJS::UCharReference::operator=):
2205 (KJS::UCharReference::ref):
2206 (KJS::UString::Rep::create):
2207 (KJS::UString::Rep::destroy):
2208 (KJS::UString::expandedSize):
2209 (KJS::UString::usedCapacity):
2210 (KJS::UString::expandCapacity):
2211 (KJS::UString::UString):
2212 (KJS::UString::null):
2213 (KJS::UString::append):
2214 (KJS::UString::operator=):
2215 (KJS::UString::toStrictUInt32):
2216 (KJS::UString::detach):
2217 (KJS::KJS::operator==):
2219 (KJS::UString::Rep::data):
2220 (KJS::UString::Rep::hash):
2222 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2226 - fix deployment build by avoiding deployment-only warning.
2228 * kjs/scope_chain.cpp:
2229 (KJS::ScopeChain::bottom):
2231 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2235 Changed things so that newly created objects get a prototype based
2236 on the scope chain of the current function, rather than the
2237 interpreter that started execution. This fixes the following bugs:
2239 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2240 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2242 * JavaScriptCore.pbproj/project.pbxproj:
2243 * kjs/array_object.cpp:
2244 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2245 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2246 (ArrayProtoFuncImp::call):
2247 (ArrayObjectImp::construct):
2248 * kjs/bool_object.cpp:
2249 (BooleanObjectImp::construct):
2250 * kjs/date_object.cpp:
2251 (DateProtoFuncImp::DateProtoFuncImp):
2252 (DateProtoFuncImp::call):
2253 (DateObjectImp::construct):
2254 * kjs/error_object.cpp:
2255 (ErrorObjectImp::construct):
2257 (FunctionImp::FunctionImp):
2258 (FunctionImp::call):
2259 (DeclaredFunctionImp::construct):
2260 (ArgumentsImp::ArgumentsImp):
2261 (GlobalFuncImp::call):
2262 * kjs/function_object.cpp:
2263 (FunctionProtoFuncImp::call):
2264 (FunctionObjectImp::construct):
2266 (BooleanImp::toObject):
2267 (StringImp::toObject):
2268 (NumberImp::toObject):
2269 (InterpreterImp::InterpreterImp):
2270 (InterpreterImp::clear):
2271 (InterpreterImp::interpreterWithGlobalObject):
2273 * kjs/interpreter.cpp:
2274 (ExecState::lexicalInterpreter):
2275 * kjs/interpreter.h:
2276 (KJS::ExecState::dynamicInterpreter):
2277 (KJS::ExecState::interpreter):
2278 * kjs/math_object.cpp:
2279 (MathFuncImp::MathFuncImp):
2281 (StatementNode::hitStatement):
2282 (StatementNode::abortStatement):
2283 (RegExpNode::evaluate):
2284 (ElementNode::evaluate):
2285 (ArrayNode::evaluate):
2286 (ObjectLiteralNode::evaluate):
2287 (PropertyValueNode::evaluate):
2288 (FunctionCallNode::evaluate):
2289 (FuncDeclNode::processFuncDecl):
2290 (FuncExprNode::evaluate):
2291 * kjs/number_object.cpp:
2292 (NumberObjectImp::construct):
2294 (KJS::ObjectImp::defaultValue):
2295 (KJS::Error::create):
2296 * kjs/object_object.cpp:
2297 (ObjectObjectImp::construct):
2298 * kjs/reference.cpp:
2299 (Reference::putValue):
2300 * kjs/regexp_object.cpp:
2301 (RegExpProtoFuncImp::call):
2302 (RegExpObjectImp::arrayOfMatches):
2303 (RegExpObjectImp::construct):
2304 * kjs/scope_chain.cpp:
2305 (KJS::ScopeChain::bottom):
2306 * kjs/scope_chain.h:
2307 * kjs/string_object.cpp:
2308 (StringProtoFuncImp::StringProtoFuncImp):
2309 (StringProtoFuncImp::call):
2310 (StringObjectImp::construct):
2316 2004-03-31 Richard Williamson <rjw@apple.com>
2318 Tedious renames based on feedback from plugin-futures list.
2319 NP_ functions are renamed with NPN_ prefix.
2320 Types prefix renamed from NP_ to NP.
2321 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2323 No review because this was just a renaming patch.
2325 * bindings/NP_jsobject.cpp:
2328 (identiferFromNPIdentifier):
2333 (NPN_RemoveProperty):
2335 (NPN_GetPropertyAtIndex):
2336 (NPN_SetPropertyAtIndex):
2337 * bindings/NP_jsobject.h:
2338 * bindings/c/c_class.cpp:
2339 (CClass::_commonInit):
2340 (CClass::classForIsA):
2342 (CClass::methodsNamed):
2343 (CClass::fieldNamed):
2344 * bindings/c/c_class.h:
2345 * bindings/c/c_instance.cpp:
2346 (CInstance::CInstance):
2347 (CInstance::~CInstance):
2348 (CInstance::operator=):
2349 (CInstance::invokeMethod):
2350 (CInstance::defaultValue):
2351 * bindings/c/c_instance.h:
2352 (KJS::Bindings::CInstance::getObject):
2353 * bindings/c/c_runtime.cpp:
2354 (CField::valueFromInstance):
2355 (CField::setValueToInstance):
2356 * bindings/c/c_runtime.h:
2357 (KJS::Bindings::CField::CField):
2358 (KJS::Bindings::CField::name):
2359 (KJS::Bindings::CMethod::CMethod):
2360 (KJS::Bindings::CMethod::name):
2361 * bindings/c/c_utility.cpp:
2362 (coerceValueToNPString):
2363 (convertValueToNPValueType):
2364 (convertNPValueTypeToValue):
2365 * bindings/c/c_utility.h:
2366 * bindings/npruntime.cpp:
2367 (NPN_IdentifierFromUTF8):
2368 (NPN_IsValidIdentifier):
2369 (NPN_GetIdentifiers):
2370 (NPN_UTF8FromIdentifier):
2373 (NPN_ReleaseObject):
2374 (NPN_IsKindOfClass):
2375 (NPN_SetExceptionWithUTF8):
2378 (NPN_CreateNumberWithInt):
2379 (NPN_CreateNumberWithFloat):
2380 (NPN_CreateNumberWithDouble):
2381 (NPN_IntFromNumber):
2382 (NPN_FloatFromNumber):
2383 (NPN_DoubleFromNumber):
2385 (NPN_CreateStringWithUTF8):
2386 (NPN_CreateStringWithUTF16):
2387 (NPN_DeallocateUTF8):
2388 (NPN_UTF8FromString):
2389 (NPN_UTF16FromString):
2392 (NPN_CreateBoolean):
2393 (NPN_BoolFromBoolean):
2396 (undefinedAllocate):
2402 (NPN_ObjectAtIndex):
2403 * bindings/npruntime.h:
2404 * bindings/runtime.cpp:
2405 (Instance::createBindingForLanguageInstance):
2406 * bindings/testbindings.cpp:
2407 (initializeIdentifiers):
2427 2004-03-31 Richard Williamson <rjw@apple.com>
2429 Changed references to NP_runtime.h to npruntime.h
2431 * JavaScriptCore.pbproj/project.pbxproj:
2432 * bindings/NP_jsobject.h:
2433 * bindings/c/c_class.h:
2434 * bindings/c/c_instance.h:
2435 * bindings/c/c_runtime.h:
2436 * bindings/c/c_utility.h:
2437 * bindings/npruntime.cpp:
2439 2004-03-31 Richard Williamson <rjw@apple.com>
2441 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2443 * JavaScriptCore.pbproj/project.pbxproj:
2444 * bindings/NP_jsobject.h:
2445 * bindings/npruntime.cpp:
2449 2004-03-23 Richard Williamson <rjw@apple.com>
2451 Added implementation of KJS::Value <-> NP_Object conversion functions.
2452 Augmented test program for 'C' bindings.
2453 Added asserts and parameter checking to all public API.
2457 * JavaScriptCore.pbproj/project.pbxproj:
2458 * bindings/NP_jsobject.cpp:
2460 * bindings/NP_jsobject.h: Added.
2461 * bindings/NP_runtime.cpp:
2462 (NP_IdentifierFromUTF8):
2463 (NP_IsValidIdentifier):
2464 (NP_GetIdentifiers):
2469 (NP_SetExceptionWithUTF8):
2472 (NP_FloatFromNumber):
2473 (NP_DoubleFromNumber):
2474 (NP_CreateStringWithUTF8):
2475 (NP_CreateStringWithUTF16):
2476 (NP_DeallocateUTF8):
2477 (NP_UTF8FromString):
2478 (NP_UTF16FromString):
2480 (NP_BoolFromBoolean):
2481 * bindings/NP_runtime.h:
2482 * bindings/c/c_instance.cpp:
2483 (CInstance::invokeMethod):
2484 * bindings/c/c_utility.cpp:
2485 (coerceValueToNPString):
2486 (convertValueToNPValueType):
2487 (convertNPValueTypeToValue):
2488 * bindings/c/c_utility.h:
2490 * bindings/testC.js: Added.
2491 * bindings/testbindings.cpp:
2501 (myInterfaceInvoke):
2502 (myInterfaceAllocate):
2506 2004-03-19 Darin Adler <darin@apple.com>
2510 - fixed problem with methods like setUTCHour
2512 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2513 GMT vs. local time function based on the utc flag.
2515 2004-03-17 Richard Williamson <rjw@apple.com>
2517 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2521 * bindings/NP_jsobject.cpp:
2526 (NP_GetPropertyAtIndex):
2527 * bindings/NP_runtime.h:
2529 2004-03-16 Richard Williamson <rjw@apple.com>
2531 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.
2535 * bindings/jni/jni_class.cpp:
2536 (JavaClass::methodsNamed):
2538 2004-03-15 Richard Williamson <rjw@apple.com>
2540 Fixed 3570854. Don't attempt to convert Null to strings. We
2541 were incorrectly converting to "Null".
2543 Actually fixed by Scott Kovatch.
2545 Reviewed by Richard.
2547 * bindings/jni/jni_utility.cpp:
2548 (KJS::Bindings::convertValueToJValue):
2552 2004-03-11 Richard Williamson <rjw@apple.com>
2554 Stitched together the NP stuff to our language independent
2555 JavaScript binding stuff. Very close to being done.
2557 Added program to test C bindings (and NP stuff). Just tests
2558 properties. Will add methods and JavaScript access, etc.
2560 Updated Makefile.am to account for new bindings/c directory.
2562 Change NP_UTF8 from "const char *" to "char" to allow for
2563 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
2566 Added NP_IsValidIdentifier().
2570 * JavaScriptCore.pbproj/project.pbxproj:
2572 * bindings/NP_jsobject.cpp:
2573 (identiferFromNPIdentifier):
2575 * bindings/NP_runtime.cpp:
2576 (NP_IdentifierFromUTF8):
2577 (NP_IsValidIdentifier):
2578 (NP_GetIdentifiers):
2579 (NP_UTF8FromIdentifier):
2580 (NP_SetExceptionWithUTF8):
2582 (NP_CreateStringWithUTF8):
2583 (NP_CreateStringWithUTF16):
2584 (NP_UTF8FromString):
2585 (NP_UTF16FromString):
2586 * bindings/NP_runtime.h:
2587 * bindings/c/c_class.cpp: Added.
2588 (CClass::_commonDelete):
2589 (CClass::_commonCopy):
2590 (CClass::_commonInit):
2591 (_createClassesByIsAIfNecessary):
2592 (CClass::classForIsA):
2595 (CClass::methodsNamed):
2596 (CClass::fieldNamed):
2597 * bindings/c/c_class.h: Added.
2598 (KJS::Bindings::CClass::~CClass):
2599 (KJS::Bindings::CClass::CClass):
2600 (KJS::Bindings::CClass::operator=):
2601 (KJS::Bindings::CClass::constructorAt):
2602 (KJS::Bindings::CClass::numConstructors):
2603 * bindings/c/c_instance.cpp: Added.
2604 (CInstance::CInstance):
2605 (CInstance::~CInstance):
2606 (CInstance::operator=):
2607 (CInstance::getClass):
2610 (CInstance::invokeMethod):
2611 (CInstance::defaultValue):
2612 (CInstance::stringValue):
2613 (CInstance::numberValue):
2614 (CInstance::booleanValue):
2615 (CInstance::valueOf):
2616 * bindings/c/c_instance.h: Added.
2617 (KJS::Bindings::CInstance::getObject):
2618 * bindings/c/c_runtime.cpp: Added.
2619 (CField::valueFromInstance):
2620 (CField::setValueToInstance):
2621 * bindings/c/c_runtime.h: Added.
2622 (KJS::Bindings::CField::CField):
2623 (KJS::Bindings::CField::name):
2624 (KJS::Bindings::CField::type):
2625 (KJS::Bindings::CMethod::CMethod):
2626 (KJS::Bindings::CMethod::name):
2627 (KJS::Bindings::CMethod::numParameters):
2628 * bindings/c/c_utility.cpp: Added.
2629 (coerceValueToNPValueType):
2630 (convertValueToNPValueType):
2631 (convertNPValueTypeToValue):
2632 * bindings/c/c_utility.h: Added.
2633 * bindings/make_testbindings:
2634 * bindings/runtime.cpp:
2635 (Instance::createBindingForLanguageInstance):
2636 * bindings/runtime.h:
2637 (KJS::Bindings::Instance::):
2638 * bindings/testbindings.cpp: Added.
2639 (initializeIdentifiers):
2640 (myInterfaceHasProperty):
2641 (myInterfaceHasMethod):
2642 (myInterfaceGetProperty):
2643 (myInterfaceSetProperty):
2644 (myInterfaceInvoke):
2645 (myInterfaceAllocate):
2646 (myInterfaceInvalidate):
2647 (myInterfaceDeallocate):
2648 (GlobalImp::className):
2649 (readJavaScriptFromFile):
2652 2004-03-10 Richard Williamson <rjw@apple.com>
2654 Made changes to support new asychronous approach to calls from
2655 plugin to JavaScript
2659 * bindings/NP_jsobject.cpp:
2664 (NP_GetPropertyAtIndex):
2665 * bindings/NP_runtime.h:
2666 * bindings/make_testbindings:
2667 * bindings/runtime.cpp:
2668 (Instance::createBindingForLanguageInstance):
2670 2004-03-10 Richard Williamson <rjw@apple.com>
2672 Updated header to include proposed changes from
2673 plugin-futures list. Calls from plugin to JavaScript
2674 are now asynchronous.
2678 * bindings/NP_runtime.h:
2682 2004-03-04 Richard Williamson <rjw@apple.com>
2684 Implementation of NP_JavaScriptObject. This is the 'C' class
2685 that wraps a JavaScript object.
2689 * JavaScriptCore.pbproj/project.pbxproj:
2690 * bindings/NP_jsobject.cpp: Added.
2691 (coerceValueToNPValueType):
2692 (convertValueToNPValueType):
2693 (convertNPValueTypeToValue):
2697 (identiferFromNPIdentifier):
2702 (NP_RemoveProperty):
2704 (NP_GetPropertyAtIndex):
2705 (NP_SetPropertyAtIndex):
2706 * bindings/NP_runtime.cpp:
2708 * bindings/NP_runtime.h:
2709 * bindings/runtime_object.h:
2711 2004-03-04 Richard Williamson <rjw@apple.com>
2713 Added NP_Array implementation.
2715 Changed NP_Boolean to just depend on two static instances, no
2716 space is required for values.
2720 * bindings/NP_runtime.cpp:
2722 (NP_BoolFromBoolean):
2728 * bindings/NP_runtime.h:
2730 2004-03-03 Darin Adler <darin@apple.com>
2734 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
2735 copyright string, and that's all that was in here.
2736 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
2738 2004-03-03 Richard Williamson <rjw@apple.com>
2740 More 'C' binding implementation. Fleshed out all the
2741 'primitive' data types.
2745 * bindings/NP_runtime.cpp:
2750 (NP_CreateStringWithUTF8):
2751 (NP_CreateStringWithUTF16):
2752 (NP_UTF8FromString):
2753 (NP_UTF16FromString):
2756 (booleanDeallocate):
2758 (NP_BoolFromBoolean):
2762 (undefinedAllocate):
2763 (undefinedDeallocate):
2765 * bindings/NP_runtime.h:
2767 2004-03-03 Richard Williamson <rjw@apple.com>
2769 More 'C' binding implementation.
2773 * bindings/NP_runtime.cpp:
2776 (getIdentifierDictionary):
2777 (NP_IdentifierFromUTF8):
2778 (NP_UTF8FromIdentifier):
2783 (NP_CreateNumberWithInt):
2784 (NP_CreateNumberWithFloat):
2785 (NP_CreateNumberWithDouble):
2787 (NP_FloatFromNumber):
2788 (NP_DoubleFromNumber):
2789 * bindings/NP_runtime.h:
2791 2004-03-02 Richard Williamson <rjw@apple.com>
2793 Removed retain/release from NP_Class. Classes will not be allowed to implement their
2794 own customer retain/release scheme.
2798 * bindings/NP_runtime.cpp:
2801 * bindings/NP_runtime.h:
2803 2004-03-02 Richard Williamson <rjw@apple.com>
2805 C binding API. Partial implementation.
2807 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.
2809 Factored root object reference counting scheme. It is now useful independent
2814 * JavaScriptCore.pbproj/project.pbxproj:
2815 * bindings/NP_runtime.cpp: Added.
2816 (NP_IdentifierFromUTF8):
2817 (NP_GetIdentifiers):
2818 (NP_UTF8FromIdentifier):
2828 (NP_RemoveProperty):
2830 (NP_GetPropertyAtIndex):
2831 (NP_SetPropertyAtIndex):
2832 (NP_CreateNumberWithInt):
2833 (NP_CreateNumberWithFloat):
2834 (NP_CreateNumberWithDouble):
2836 (NP_FloatFromNumber):
2837 (NP_DoubleFromNumber):
2838 (NP_CreateStringWithUTF8):
2839 (NP_CreateStringWithUTF16):
2840 (NP_UTF8FromString):
2841 (NP_UTF16FromString):
2843 (NP_BoolFromBoolean):
2849 * bindings/NP_runtime.h: Added.
2850 * bindings/jni/jni_jsobject.cpp:
2852 (JSObject::finalize):
2853 (JSObject::createNative):
2854 (JSObject::convertValueToJObject):
2855 * bindings/jni/jni_jsobject.h:
2856 * bindings/objc/objc_jsobject.h:
2857 * bindings/objc/objc_jsobject.mm:
2859 (windowJavaScriptObject):
2860 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2861 (-[JavaScriptObject dealloc]):
2862 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
2863 (-[JavaScriptObject call:arguments:]):
2864 (-[JavaScriptObject evaluate:]):
2865 (-[JavaScriptObject getMember:]):
2866 (-[JavaScriptObject setMember:value:]):
2867 (-[JavaScriptObject removeMember:]):
2868 (-[JavaScriptObject toString]):
2869 (-[JavaScriptObject getSlot:]):
2870 (-[JavaScriptObject setSlot:value:]):
2871 * bindings/objc/objc_utility.h:
2872 * bindings/objc/objc_utility.mm:
2873 (KJS::Bindings::convertValueToObjcValue):
2874 * bindings/runtime_root.cpp: Added.
2875 (getReferencesByRootDictionary):
2876 (getReferencesDictionary):
2877 (KJS::Bindings::findReferenceDictionary):
2878 (KJS::Bindings::rootForImp):
2879 (KJS::Bindings::addNativeReference):
2880 (KJS::Bindings::removeNativeReference):
2881 (completedJavaScriptAccess):
2882 (initializeJavaScriptAccessLock):
2883 (lockJavaScriptAccess):
2884 (unlockJavaScriptAccess):
2885 (RootObject::dispatchToJavaScriptThread):
2886 (performJavaScriptAccess):
2887 (RootObject::setFindRootObjectForNativeHandleFunction):
2888 (RootObject::removeAllNativeReferences):
2889 * bindings/runtime_root.h: Added.
2890 (KJS::Bindings::RootObject::RootObject):
2891 (KJS::Bindings::RootObject::~RootObject):
2892 (KJS::Bindings::RootObject::setRootObjectImp):
2893 (KJS::Bindings::RootObject::rootObjectImp):
2894 (KJS::Bindings::RootObject::setInterpreter):
2895 (KJS::Bindings::RootObject::interpreter):
2896 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
2897 (KJS::Bindings::RootObject::runLoop):
2898 (KJS::Bindings::RootObject::performJavaScriptSource):
2904 2004-02-18 Richard Williamson <rjw@apple.com>
2906 Added NSNumber/Number conversion.
2908 Removed some unnecessary KJS:: namespace specifiers.
2912 * bindings/objc/objc_utility.mm:
2913 (KJS::Bindings::convertValueToObjcValue):
2914 (KJS::Bindings::convertObjcValueToValue):
2915 * bindings/runtime_array.h:
2917 2004-02-18 Richard Williamson <rjw@apple.com>
2919 Added support for export NSArrays.
2921 Updated valueAt() to take an ExecState so we can throw
2924 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
2925 ObjectiveC classes to control the visibility of their methods in
2930 * bindings/jni/jni_runtime.cpp:
2931 (JavaField::valueFromInstance):
2932 (JavaArray::valueAt):
2933 * bindings/jni/jni_runtime.h:
2934 * bindings/objc/objc_class.mm:
2935 (ObjcClass::methodsNamed):
2936 * bindings/objc/objc_runtime.h:
2937 (KJS::Bindings::ObjcArray::getObjcArray):
2938 * bindings/objc/objc_runtime.mm:
2939 (ObjcField::valueFromInstance):
2940 (ObjcField::setValueToInstance):
2941 (ObjcArray::ObjcArray):
2942 (ObjcArray::~ObjcArray):
2943 (ObjcArray::operator=):
2944 (ObjcArray::setValueAt):
2945 (ObjcArray::valueAt):
2946 (ObjcArray::getLength):
2947 * bindings/objc/objc_utility.mm:
2948 (KJS::Bindings::convertValueToObjcValue):
2949 (KJS::Bindings::convertObjcValueToValue):
2950 * bindings/runtime.cpp:
2951 (Instance::getValueOfField):
2952 * bindings/runtime.h:
2953 * bindings/runtime_array.cpp:
2954 (RuntimeArrayImp::get):
2955 * bindings/runtime_object.cpp:
2956 (RuntimeObjectImp::get):
2958 2004-02-17 Richard Williamson <rjw@apple.com>
2960 Added String <-> NSString conversion.
2961 Added tests of String <-> NSString conversion to test program.
2965 * bindings/objc/objc_utility.mm:
2966 (KJS::Bindings::convertValueToObjcValue):
2967 (KJS::Bindings::convertObjcValueToValue):
2969 * bindings/testbindings.mm:
2970 (-[MyFirstInterface getString]):
2972 2004-02-15 Darin Adler <darin@apple.com>
2976 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
2977 and removing redundant settings of things that match defaults in other build styles.
2979 2004-02-13 Richard Williamson <rjw@apple.com>
2981 Work towards the JavaScript ObjC bindings. The bindings now work for
2982 simple scalar types. testbindings.mm is an illustration of how the
2987 * JavaScriptCore.pbproj/project.pbxproj:
2989 * bindings/jni/jni_class.cpp:
2990 (JavaClass::methodsNamed):
2991 * bindings/jni/jni_class.h:
2992 * bindings/jni/jni_instance.cpp:
2993 (JavaInstance::invokeMethod):
2994 * bindings/jni/jni_instance.h:
2995 * bindings/jni/jni_runtime.h:
2996 (KJS::Bindings::JavaMethod::returnType):
2997 * bindings/make_testbindings: Added.
2998 * bindings/objc/objc_class.h: Added.
2999 (KJS::Bindings::ObjcClass::~ObjcClass):
3000 (KJS::Bindings::ObjcClass::ObjcClass):
3001 (KJS::Bindings::ObjcClass::operator=):
3002 (KJS::Bindings::ObjcClass::constructorAt):
3003 (KJS::Bindings::ObjcClass::numConstructors):
3004 * bindings/objc/objc_class.mm: Added.
3005 (ObjcClass::_commonDelete):
3006 (ObjcClass::_commonCopy):
3007 (ObjcClass::_commonInit):
3008 (_createClassesByIsAIfNecessary):
3009 (ObjcClass::classForIsA):
3010 (ObjcClass::ObjcClass):
3012 (ObjcClass::methodsNamed):
3013 (ObjcClass::fieldNamed):
3014 * bindings/objc/objc_header.h: Added.
3015 * bindings/objc/objc_instance.h: Added.
3016 (KJS::Bindings::ObjcInstance::getObject):
3017 * bindings/objc/objc_instance.mm: Added.
3018 (ObjcInstance::ObjcInstance):
3019 (ObjcInstance::~ObjcInstance):
3020 (ObjcInstance::operator=):
3021 (ObjcInstance::begin):
3022 (ObjcInstance::end):
3023 (ObjcInstance::getClass):
3024 (ObjcInstance::invokeMethod):
3025 (ObjcInstance::defaultValue):
3026 (ObjcInstance::stringValue):
3027 (ObjcInstance::numberValue):
3028 (ObjcInstance::booleanValue):
3029 (ObjcInstance::valueOf):
3030 * bindings/objc/objc_jsobject.h: Added.
3031 * bindings/objc/objc_jsobject.mm: Added.
3032 * bindings/objc/objc_runtime.h:
3033 (KJS::Bindings::ObjcField::~ObjcField):
3034 (KJS::Bindings::ObjcField::ObjcField):
3035 (KJS::Bindings::ObjcField::operator=):
3036 (KJS::Bindings::ObjcMethod::ObjcMethod):
3037 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3038 (KJS::Bindings::ObjcMethod::operator=):
3039 * bindings/objc/objc_runtime.mm: Added.
3040 (ObjcMethod::ObjcMethod):
3042 (ObjcMethod::numParameters):
3043 (ObjcMethod::getMethodSignature):
3044 (ObjcField::ObjcField):
3047 (ObjcField::valueFromInstance):
3048 (ObjcField::setValueToInstance):
3049 * bindings/objc/objc_utility.h: Added.
3051 * bindings/objc/objc_utility.mm: Added.
3052 (KJS::Bindings::JSMethodNameToObjCMethodName):
3053 (KJS::Bindings::convertValueToObjcValue):
3054 (KJS::Bindings::convertObjcValueToValue):
3055 (KJS::Bindings::objcValueTypeForType):
3056 * bindings/runtime.cpp:
3057 (MethodList::MethodList):
3058 (MethodList::operator=):
3059 (Instance::setValueOfField):
3060 (Instance::createBindingForLanguageInstance):
3061 (Instance::createRuntimeObject):
3062 * bindings/runtime.h:
3063 * bindings/runtime_method.cpp:
3064 (RuntimeMethodImp::RuntimeMethodImp):
3065 (RuntimeMethodImp::get):
3066 (RuntimeMethodImp::call):
3067 * bindings/runtime_method.h:
3068 * bindings/runtime_object.cpp:
3069 (RuntimeObjectImp::get):
3070 (RuntimeObjectImp::hasProperty):
3071 * bindings/test.js: Added.
3072 * bindings/testbindings.mm: Added.
3073 (-[MySecondInterface init]):
3074 (-[MyFirstInterface init]):
3075 (-[MyFirstInterface dealloc]):
3076 (+[MyFirstInterface JavaScriptNameForSelector:]):
3077 (-[MyFirstInterface getInt]):
3078 (-[MyFirstInterface setInt:]):
3079 (-[MyFirstInterface getMySecondInterface]):
3080 (-[MyFirstInterface logMessage:]):
3081 (GlobalImp::className):
3082 (readJavaScriptFromFile):
3087 2004-02-08 Darin Adler <darin@apple.com>
3091 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3093 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3094 macros from working right in C++ code that uses the <cctype> header.
3097 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3098 (KJS::UTF8SequenceLengthNonASCII): Added.
3099 (KJS::inlineUTF8SequenceLength): Added.
3100 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3101 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3102 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3103 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3104 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3106 - fixed the test program so it won't hit the interpreter lock assertion
3108 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3112 2004-02-06 Richard Williamson <rjw@apple.com>
3114 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.
3118 * bindings/jni/jni_jsobject.cpp:
3119 (JSObject::toString):
3120 * bindings/jni/jni_utility.cpp:
3121 (KJS::Bindings::convertValueToJValue):
3123 2004-02-02 Darin Adler <darin@apple.com>
3127 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3129 * kjs/array_object.cpp:
3130 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3131 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3132 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3133 number is out of range. This prevents new Array(-1) from causing trouble.
3135 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3137 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3138 casting to int. Results now match those in other browsers.
3140 2004-02-02 Darin Adler <darin@apple.com>
3144 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3145 - fixed other related overflow issues
3147 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3149 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3150 must not restrict values to the range of a particular integer type.
3151 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3152 proper handling for negative results from fmod.
3153 (ValueImp::toUInt32): Ditto.
3154 (ValueImp::toUInt16): Ditto.
3155 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3157 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3158 out-of-integer-range values better in the slice function.
3159 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3160 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3161 out-of-integer-range values better in the toString function.
3162 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3163 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3164 and substr functions.
3168 2004-01-30 Richard Williamson <rjw@apple.com>
3170 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3174 * bindings/jni/jni_instance.cpp:
3175 (JavaInstance::stringValue):
3177 2004-01-26 Darin Adler <darin@apple.com>
3179 * Makefile.am: Switch from pbxbuild to xcodebuild.
3181 2004-01-22 Richard Williamson <rjw@apple.com>
3183 Added stubs for ObjC language binding to JavaScript.
3185 * JavaScriptCore.pbproj/project.pbxproj:
3186 * bindings/jni/jni_runtime.h:
3187 * bindings/objc/objc_runtime.h: Added.
3188 (KJS::Bindings::ObjcParameter::ObjcParameter):
3189 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3190 (KJS::Bindings::ObjcParameter::operator=):
3191 (KJS::Bindings::ObjcParameter::type):
3192 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3193 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3194 (KJS::Bindings::ObjcConstructor::_commonCopy):
3195 (KJS::Bindings::ObjcConstructor::operator=):
3196 (KJS::Bindings::ObjcConstructor::value):
3197 (KJS::Bindings::ObjcConstructor::parameterAt):
3198 (KJS::Bindings::ObjcConstructor::numParameters):
3199 (KJS::Bindings::ObjcField::ObjcField):
3200 (KJS::Bindings::ObjcField::~ObjcField):
3201 * bindings/runtime.h:
3203 2004-01-22 Richard Williamson <rjw@apple.com>
3205 Simplified JavaString by using UString as backing store. This
3206 revealed a bug in CString's assignment operator which I fixed.
3208 Removed some dead code.
3212 * bindings/jni/jni_runtime.h:
3213 (KJS::Bindings::JavaString::JavaString):
3214 (KJS::Bindings::JavaString::_commonInit):
3215 (KJS::Bindings::JavaString::UTF8String):
3216 (KJS::Bindings::JavaString::uchars):
3217 (KJS::Bindings::JavaString::length):
3218 (KJS::Bindings::JavaString::ustring):
3219 * bindings/runtime_object.cpp:
3220 (RuntimeObjectImp::RuntimeObjectImp):
3221 * bindings/runtime_object.h:
3223 (KJS::CString::CString):
3224 (KJS::CString::operator=):
3230 2004-01-16 Richard Williamson <rjw@apple.com>
3232 Fixed 3525853. We weren't handling mapping to overloaded Java
3233 methods very well. Even though this is undefined the other
3234 browsers support it. Also fixed a bug with returning arrays
3235 from Java functions.
3239 * bindings/jni/jni_class.cpp:
3240 (JavaClass::_commonInit):
3241 (JavaClass::methodsNamed):
3242 * bindings/jni/jni_class.h:
3243 * bindings/jni/jni_instance.cpp:
3244 (JavaInstance::invokeMethod):
3245 * bindings/jni/jni_instance.h:
3246 * bindings/jni/jni_runtime.cpp:
3247 (JavaArray::convertJObjectToArray):
3248 (JavaField::valueFromInstance):
3249 (JavaMethod::signature):
3250 (JavaArray::valueAt):
3251 * bindings/jni/jni_runtime.h:
3252 * bindings/jni_jsobject.cpp:
3254 (JSObject::convertJObjectToValue):
3255 * bindings/runtime.cpp:
3256 (MethodList::addMethod):
3257 (MethodList::length):
3258 (MethodList::methodAt):
3259 (MethodList::~MethodList):
3260 * bindings/runtime.h:
3261 (KJS::Bindings::MethodList::MethodList):
3262 * bindings/runtime_method.cpp:
3263 (RuntimeMethodImp::RuntimeMethodImp):
3264 (RuntimeMethodImp::get):
3265 (RuntimeMethodImp::call):
3266 * bindings/runtime_method.h:
3267 * bindings/runtime_object.cpp:
3268 (RuntimeObjectImp::get):
3269 (RuntimeObjectImp::hasProperty):
3271 2004-01-16 Richard Williamson <rjw@apple.com>
3273 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3274 protection implemented for 3530401.
3278 * bindings/runtime_method.cpp:
3279 (RuntimeMethodImp::call):
3281 2004-01-15 Richard Williamson <rjw@apple.com>
3283 Fixed 3530401. JNI doesn't cleanup local refs created on the
3284 main thread. IMO this is a bad bug in our JMI implementation.
3286 To work-around the problem I explicitly delete all local refs.
3287 Further, I've added Push/PopLocalFrame calls to catch any refs
3288 that I may have missed. This will guarantee that we don't leak
3289 any Java references.
3293 * bindings/jni/jni_class.cpp:
3294 (JavaClass::_commonInit):
3295 (JavaClass::JavaClass):
3296 * bindings/jni/jni_instance.cpp:
3297 (JavaInstance::begin):
3298 (JavaInstance::end):
3299 * bindings/jni/jni_instance.h:
3300 * bindings/jni/jni_runtime.cpp:
3301 (JavaConstructor::JavaConstructor):
3302 (JavaMethod::JavaMethod):
3303 * bindings/jni_jsobject.cpp:
3304 (JSObject::listFromJArray):
3305 * bindings/runtime.h:
3306 (KJS::Bindings::Instance::begin):
3307 (KJS::Bindings::Instance::end):
3308 * bindings/runtime_object.cpp:
3309 (RuntimeObjectImp::get):
3310 (RuntimeObjectImp::put):
3311 (RuntimeObjectImp::canPut):
3312 (RuntimeObjectImp::hasProperty):
3313 (RuntimeObjectImp::defaultValue):
3315 2004-01-15 Vicki Murley <vicki@apple.com>
3319 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3321 2004-01-14 Richard Williamson <rjw@apple.com>
3323 Fixed 3529466. With recent changes to Java plugin we must no
3324 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3328 * bindings/jni/jni_instance.cpp:
3329 (JObjectWrapper::JObjectWrapper):
3333 2004-01-14 Richard Williamson <rjw@apple.com>
3337 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.
3341 * bindings/jni_jsobject.cpp:
3343 (removeJavaReference):
3344 (RootObject::removeAllJavaReferencesForRoot):
3347 2004-01-13 Richard Williamson <rjw@apple.com>
3351 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.
3355 * bindings/jni_jsobject.h:
3356 (KJS::Bindings::RootObject::~RootObject):
3362 2004-01-06 Richard Williamson <rjw@apple.com>
3364 Fixed 3521814. Finalize messages weren't being dispatched!
3368 * bindings/jni_jsobject.cpp:
3371 2004-01-05 Richard Williamson <rjw@apple.com>
3373 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
3374 described by 3515579.
3376 Also cleanup up logging of Java exceptions.
3380 * bindings/jni/jni_class.cpp:
3381 (JavaClass::classForInstance):
3382 * bindings/jni/jni_instance.cpp:
3383 (JavaInstance::JavaInstance):
3384 (JavaInstance::getClass):
3385 (JavaInstance::invokeMethod):
3386 (JObjectWrapper::JObjectWrapper):
3387 (JObjectWrapper::~JObjectWrapper):
3388 * bindings/jni/jni_instance.h:
3389 (KJS::Bindings::JavaInstance::operator=):
3390 * bindings/jni/jni_runtime.cpp:
3391 (JavaMethod::JavaMethod):
3392 (JavaMethod::methodID):
3393 * bindings/jni/jni_runtime.h:
3394 (KJS::Bindings::JavaMethod::JavaMethod):
3395 * bindings/jni/jni_utility.cpp:
3399 (KJS::Bindings::getMethodID):
3400 (KJS::Bindings::callJNIVoidMethodIDA):
3401 (KJS::Bindings::callJNIObjectMethodIDA):
3402 (KJS::Bindings::callJNIByteMethodIDA):
3403 (KJS::Bindings::callJNICharMethodIDA):
3404 (KJS::Bindings::callJNIShortMethodIDA):
3405 (KJS::Bindings::callJNIIntMethodIDA):
3406 (KJS::Bindings::callJNILongMethodIDA):
3407 (KJS::Bindings::callJNIFloatMethodIDA):
3408 (KJS::Bindings::callJNIDoubleMethodIDA):
3409 (KJS::Bindings::callJNIBooleanMethodIDA):
3410 (KJS::Bindings::getCharactersFromJStringInEnv):
3411 (KJS::Bindings::getUCharactersFromJStringInEnv):
3412 (KJS::Bindings::getJNIField):
3413 * bindings/jni/jni_utility.h:
3415 l2003-12-23 John Sullivan <sullivan@apple.com>
3417 * JavaScriptCore.pbproj/project.pbxproj:
3418 Xcode version wars, harmless
3420 2003-12-23 Darin Adler <darin@apple.com>
3422 Reviewed by John (concept, not code, which is just the old code coming back).
3424 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
3426 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
3427 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
3429 2003-12-19 Richard Williamson <rjw@apple.com>
3431 Fixed 3515597. When an error occurs we need
3432 to make sure result values are zeroed.
3434 Cleaned up logs by adding a newline.
3438 * bindings/jni/jni_utility.cpp:
3439 (KJS::Bindings::getJavaVM):
3440 (KJS::Bindings::getJNIEnv):
3443 (KJS::Bindings::getJNIField):
3444 * bindings/jni_jsobject.cpp:
3445 (JSObject::convertValueToJObject):
3449 2003-12-17 Richard Williamson <rjw@apple.com>
3451 Ensure that all the symbols we export are in the KJS
3452 namespace (3512245).
3454 Also renamed JavaString.characters() to JavaString.UTF8String()
3455 for enhanced clarity.
3457 Added some sanity checking to constructor of JObjectWrapper.
3462 * bindings/jni/jni_class.cpp:
3463 * bindings/jni/jni_class.h:
3464 * bindings/jni/jni_instance.cpp:
3465 (JavaInstance::invokeMethod):
3466 (JObjectWrapper::JObjectWrapper):
3467 * bindings/jni/jni_instance.h:
3468 * bindings/jni/jni_runtime.cpp:
3469 (JavaParameter::JavaParameter):
3470 (JavaField::JavaField):
3471 (JavaMethod::JavaMethod):
3472 (JavaMethod::signature):
3473 * bindings/jni/jni_runtime.h:
3474 (KJS::Bindings::JavaString::ascii):
3475 (KJS::Bindings::JavaString::UTF8String):
3476 (KJS::Bindings::JavaString::JavaString):
3477 (KJS::Bindings::JavaString::_commonInit):
3478 (KJS::Bindings::JavaString::uchars):
3479 (KJS::Bindings::JavaString::length):
3480 (KJS::Bindings::JavaString::ustring):
3481 (KJS::Bindings::JavaParameter::type):
3482 (KJS::Bindings::JavaField::name):
3483 (KJS::Bindings::JavaField::type):
3484 (KJS::Bindings::JavaMethod::name):
3485 (KJS::Bindings::JavaMethod::returnType):
3486 * bindings/jni/jni_utility.cpp:
3487 (KJS::Bindings::getJavaVM):
3488 (KJS::Bindings::getJNIEnv):
3489 (KJS::Bindings::callJNIVoidMethod):
3490 (KJS::Bindings::callJNIObjectMethod):
3491 (KJS::Bindings::callJNIBooleanMethod):
3492 (KJS::Bindings::callJNIByteMethod):
3493 (KJS::Bindings::callJNICharMethod):
3494 (KJS::Bindings::callJNIShortMethod):
3495 (KJS::Bindings::callJNIIntMethod):
3496 (KJS::Bindings::callJNILongMethod):
3497 (KJS::Bindings::callJNIFloatMethod):
3498 (KJS::Bindings::callJNIDoubleMethod):
3499 (KJS::Bindings::callJNIVoidMethodA):
3500 (KJS::Bindings::callJNIObjectMethodA):
3501 (KJS::Bindings::callJNIByteMethodA):
3502 (KJS::Bindings::callJNICharMethodA):
3503 (KJS::Bindings::callJNIShortMethodA):
3504 (KJS::Bindings::callJNIIntMethodA):
3505 (KJS::Bindings::callJNILongMethodA):
3506 (KJS::Bindings::callJNIFloatMethodA):
3507 (KJS::Bindings::callJNIDoubleMethodA):
3508 (KJS::Bindings::callJNIBooleanMethodA):
3509 (KJS::Bindings::getCharactersFromJString):
3510 (KJS::Bindings::releaseCharactersForJString):
3511 (KJS::Bindings::getCharactersFromJStringInEnv):
3512 (KJS::Bindings::releaseCharactersForJStringInEnv):
3513 (KJS::Bindings::getUCharactersFromJStringInEnv):
3514 (KJS::Bindings::releaseUCharactersForJStringInEnv):
3515 (KJS::Bindings::JNITypeFromClassName):
3516 (KJS::Bindings::signatureFromPrimitiveType):
3517 (KJS::Bindings::JNITypeFromPrimitiveType):
3518 (KJS::Bindings::getJNIField):
3519 (KJS::Bindings::convertValueToJValue):
3520 * bindings/jni/jni_utility.h:
3521 * bindings/jni_jsobject.cpp:
3522 (KJS::Bindings::JSObject::invoke):
3523 (KJS::Bindings::JSObject::JSObject):
3524 (KJS::Bindings::JSObject::call):
3525 (KJS::Bindings::JSObject::eval):
3526 (KJS::Bindings::JSObject::getMember):
3527 (KJS::Bindings::JSObject::setMember):
3528 (KJS::Bindings::JSObject::removeMember):
3529 (KJS::Bindings::JSObject::getSlot):
3530 (KJS::Bindings::JSObject::setSlot):
3531 (KJS::Bindings::JSObject::toString):
3532 (KJS::Bindings::JSObject::finalize):
3533 (KJS::Bindings::JSObject::createNative):
3534 (KJS::Bindings::JSObject::convertValueToJObject):
3535 (KJS::Bindings::JSObject::convertJObjectToValue):
3536 (KJS::Bindings::JSObject::listFromJArray):
3537 * bindings/jni_jsobject.h:
3538 * bindings/runtime.cpp:
3539 * bindings/runtime.h:
3540 * bindings/runtime_method.cpp:
3541 * bindings/runtime_method.h:
3545 2003-12-16 Richard Williamson <rjw@apple.com>
3547 Ack! More assertions. Lock ALL entry points into the interpreter!
3552 * bindings/jni_jsobject.cpp:
3553 (Bindings::JSObject::call):
3554 (Bindings::JSObject::eval):
3555 (Bindings::JSObject::getMember):
3556 (Bindings::JSObject::setMember):
3557 (Bindings::JSObject::removeMember):
3558 (Bindings::JSObject::getSlot):
3559 (Bindings::JSObject::setSlot):
3560 (Bindings::JSObject::convertJObjectToValue):
3562 2003-12-15 Richard Williamson <rjw@apple.com>
3564 Fixed a couple of snafus and removed some logging.
3568 * bindings/jni_jsobject.cpp:
3569 (Bindings::performJavaScriptAccess):
3570 (Bindings::completedJavaScriptAccess):
3571 (Bindings::dispatchToJavaScriptThread):
3572 Removed some annoying JS_LOG clutter.
3574 (Bindings::RootObject::removeAllJavaReferencesForRoot):