1 2004-09-12 Darin Adler <darin@apple.com>
3 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
4 of escape and unescape.
6 2004-09-12 Darin Adler <darin@apple.com>
10 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
12 * kjs/date_object.cpp:
13 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
15 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
17 2004-09-09 Maciej Stachowiak <mjs@apple.com>
21 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
24 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
25 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
27 (Lexer::isHexDigit): Made static and non-const.
32 2004-09-06 Darin Adler <darin@apple.com>
34 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
38 2004-09-01 Richard Williamson <rjw@apple.com>
40 Add pid to exception messages (to help debug dashboard clients).
44 * kjs/interpreter.cpp:
45 (Interpreter::evaluate):
49 2004-08-20 Richard Williamson <rjw@apple.com>
51 Implemented new JNI abstraction. We no longer invoke Java methods
52 directly with JNI, rather we call into the plugin. This allows the
53 plugin to dispatch the call to the appropriate VM thread. This
54 change should (will?) fix a whole class of threading related problems with
59 * JavaScriptCore.pbproj/project.pbxproj:
60 * bindings/c/c_instance.h:
61 (KJS::Bindings::CInstance::setExecutionContext):
62 (KJS::Bindings::CInstance::executionContext):
63 * bindings/jni/jni_instance.cpp:
64 (JavaInstance::JavaInstance):
65 (JavaInstance::invokeMethod):
66 (JavaInstance::setExecutionContext):
67 (JavaInstance::executionContext):
68 * bindings/jni/jni_instance.h:
69 * bindings/jni/jni_jsobject.cpp:
70 (JSObject::convertJObjectToValue):
71 * bindings/jni/jni_runtime.cpp:
72 (JavaField::JavaField):
73 (JavaArray::convertJObjectToArray):
74 (JavaField::valueFromInstance):
75 (JavaArray::JavaArray):
77 * bindings/jni/jni_runtime.h:
78 (KJS::Bindings::JavaArray::operator=):
79 (KJS::Bindings::JavaArray::executionContext):
80 * bindings/jni/jni_utility.h:
81 * bindings/objc/objc_instance.h:
82 (KJS::Bindings::ObjcInstance::setExecutionContext):
83 (KJS::Bindings::ObjcInstance::executionContext):
84 * bindings/runtime.cpp:
85 (Instance::createBindingForLanguageInstance):
87 * bindings/runtime_root.h:
88 (KJS::Bindings::RootObject::nativeHandle):
92 2004-08-19 Vicki Murley <vicki@apple.com>
96 * kjs/property_map.cpp:
97 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
99 2004-08-17 Darin Adler <darin@apple.com>
103 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
105 * kjs/property_map.h: Added some private functions.
106 * kjs/property_map.cpp:
107 (KJS::PropertyMap::clear): Set sentinelCount to 0.
108 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
109 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
110 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
111 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
112 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
113 deleted-element sentinels.
114 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
116 2004-08-16 Maciej Stachowiak <mjs@apple.com>
118 Code change by Eric Albert, reviewd by me.
120 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
122 * kjs/date_object.cpp:
123 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
124 entirely would be even better, but is not required to fix this bug.
128 2004-08-16 Richard Williamson <rjw@apple.com>
130 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
132 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
136 * bindings/NP_jsobject.cpp:
138 * bindings/jni/jni_jsobject.cpp:
140 * bindings/objc/WebScriptObject.mm:
141 (-[WebScriptObject evaluateWebScript:]):
143 2004-08-15 Richard Williamson <rjw@apple.com>
145 More updates to np headers. Implemented new NPN functions.
149 * bindings/NP_jsobject.cpp:
153 * bindings/npruntime.h:
155 2004-08-13 Darin Adler <darin@apple.com>
157 - fix build so we can compile again
159 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
160 is good enough so that we can compile, but it's only a stopgap measure, because I think
161 Richard has a newer one he wants to check in.
163 2004-08-12 Richard Williamson <rjw@apple.com>
165 Bring npruntime.h and friends closer to compliance with
170 * JavaScriptCore.pbproj/project.pbxproj:
171 * bindings/NP_jsobject.cpp:
173 (_NPN_CreateScriptObject):
178 (NPN_RemoveProperty):
179 * bindings/NP_jsobject.h:
180 * bindings/c/c_instance.cpp:
181 (CInstance::invokeMethod):
182 * bindings/c/c_utility.cpp:
183 (convertNPVariantToValue):
184 * bindings/npruntime.cpp:
185 (NPN_IdentifierIsString):
188 (NPN_VariantIsUndefined):
190 (NPN_VariantIsInt32):
191 (NPN_VariantIsDouble):
192 (NPN_VariantIsString):
193 (NPN_VariantIsObject):
195 (NPN_VariantToString):
196 (NPN_VariantToInt32):
197 (NPN_VariantToDouble):
198 (NPN_VariantToObject):
199 (NPN_InitializeVariantAsVoid):
200 (NPN_InitializeVariantAsNull):
201 (NPN_InitializeVariantAsUndefined):
202 (NPN_InitializeVariantWithBool):
203 (NPN_InitializeVariantWithInt32):
204 (NPN_InitializeVariantWithDouble):
205 (NPN_InitializeVariantWithString):
206 (NPN_InitializeVariantWithStringCopy):
207 (NPN_InitializeVariantWithObject):
208 (NPN_InitializeVariantWithVariant):
209 (NPN_ReleaseVariantValue):
211 * bindings/npruntime.h:
213 (_NPString::_NPVariant::):
214 * bindings/npruntime_priv.h: Added.
216 2004-08-12 Darin Adler <darin@apple.com>
220 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
223 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
224 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
225 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
226 to skip leading "+" or "-".
230 2004-08-12 Darin Adler <darin@apple.com>
234 - fixed 43 Mozilla JavaScript tests
236 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
237 * kjs/date_object.cpp:
238 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
239 than constructing a number object to pass to it.
240 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
241 (KJS::parseDate): Change to return a double instead of creating the Number object here.
242 (KJS::timeClip): Implement this as specified in the language standard.
244 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
245 flags on the prototype property.
248 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
250 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
252 (KJS::parseDigit): Added. Helper function for parseInt.
253 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
254 strtoll can handle. Also matches standard more closely.
255 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
257 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
259 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
261 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
263 (Lexer::setCode): Clear error state.
264 (Lexer::lex): Set error state if the lexer encounters an error
267 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
268 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
270 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
271 Change round to round values between -0.5 and -0 to -0 instead of +0.
273 * kjs/nodes.h: Add evaluateReference function to GroupNode.
274 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
275 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
276 would change x.y into a value that can't be deleted as a side effect.
278 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
281 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
282 get rid of the fixed size limit for code.
284 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
285 returns the string without creating a new Rep, since I'm using substr in a place where it will
288 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
289 the other day that was making a couple tests fail.
290 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
291 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
292 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
293 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
294 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
296 * kjs/string_object.lut.h: Regenerated.
298 2004-08-11 Darin Adler <darin@apple.com>
300 - fixed a tiny problem with the UTF-16 PCRE check-in
302 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
303 the ctype_meta flag to get set in items that should not have it.
305 * pcre/chartables.c: Regenerated.
307 2004-08-10 Richard Williamson <rjw@apple.com>
309 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
311 The following WebScripting methods are now supported on bound
314 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
315 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
316 - (id)valueForUndefinedKey:(NSString *)key
320 * bindings/c/c_class.cpp:
321 (CClass::fieldNamed):
322 * bindings/c/c_class.h:
323 * bindings/jni/jni_class.cpp:
324 (JavaClass::fieldNamed):
325 * bindings/jni/jni_class.h:
326 * bindings/objc/objc_class.h:
327 (KJS::Bindings::ObjcClass::isa):
328 * bindings/objc/objc_class.mm:
329 (ObjcClass::methodsNamed):
330 (ObjcClass::fieldNamed):
331 (ObjcClass::fallbackObject):
332 * bindings/objc/objc_instance.h:
333 * bindings/objc/objc_instance.mm:
334 (ObjcInstance::invokeMethod):
335 (ObjcInstance::setValueOfField):
336 (ObjcInstance::setValueOfUndefinedField):
337 (ObjcInstance::getValueOfField):
338 (ObjcInstance::getValueOfUndefinedField):
339 * bindings/objc/objc_runtime.h:
340 (KJS::Bindings::ObjcField::~ObjcField):
341 (KJS::Bindings::ObjcField::ObjcField):
342 (KJS::Bindings::ObjcField::operator=):
343 (KJS::Bindings::FallbackObjectImp::classInfo):
344 * bindings/objc/objc_runtime.mm:
345 (ObjcField::ObjcField):
348 (ObjcField::valueFromInstance):
349 (ObjcField::setValueToInstance):
350 (FallbackObjectImp::FallbackObjectImp):
351 (FallbackObjectImp::get):
352 (FallbackObjectImp::put):
353 (FallbackObjectImp::canPut):
354 (FallbackObjectImp::implementsCall):
355 (FallbackObjectImp::call):
356 (FallbackObjectImp::hasProperty):
357 (FallbackObjectImp::deleteProperty):
358 (FallbackObjectImp::defaultValue):
359 * bindings/runtime.h:
360 (KJS::Bindings::Class::fallbackObject):
361 (KJS::Bindings::Instance::getValueOfUndefinedField):
362 (KJS::Bindings::Instance::setValueOfUndefinedField):
363 * bindings/runtime_object.cpp:
364 (RuntimeObjectImp::get):
365 (RuntimeObjectImp::put):
366 (RuntimeObjectImp::canPut):
367 (RuntimeObjectImp::hasProperty):
368 * bindings/testbindings.mm:
369 (-[MyFirstInterface valueForUndefinedKey:]):
370 (-[MyFirstInterface setValue:forUndefinedKey:]):
372 2004-08-10 Darin Adler <darin@apple.com>
376 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
378 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
379 or uint16_t depending on the mode, and used appropriate in the 7 public functions
381 * pcre/pcre.c: Add UTF-16 support to all functions.
382 * pcre/study.c: Ditto.
384 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
385 the mode. Changed declarations to use symbolic constants and typedefs so we size
386 things to ichar when needed.
388 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
389 sized to 16-bit characters instead of 8-bit.
392 (pcre_copy_substring): Use pcre_char instead of char.
393 (pcre_get_substring_list): Ditto.
394 (pcre_free_substring_list): Ditto.
395 (pcre_get_substring): Ditto.
396 (pcre_free_substring): Ditto.
398 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
399 of hard-coding 8-bit table sizes.
401 * pcre/chartables.c: Regenerated.
403 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
404 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
405 is not null. The null string still has a null pointer. This prevents us from
406 passing a null through to the regular expression engine (which results in a null
407 error even when the string length is 0).
410 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
411 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
413 2004-08-09 Darin Adler <darin@apple.com>
417 - fixed 28 Mozilla JavaScript tests
419 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
420 checking the number of arguments for the join method.
422 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
423 than integers, so we aren't limited to 32 bits.
425 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
426 the implementation of the pow operation. Also simplied a case that was handling positive
427 and negative infinity separately.
429 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
430 putting them in a long, so that unsigned shift will work properly.
432 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
434 * kjs/operations.cpp:
435 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
436 sign of isinf; our isinf function returns +1 even for negative infinity.
437 (KJS::isNegInf): And again.
438 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
439 Our floating point already handles the various infinity cases correctly.
441 * kjs/regexp_object.cpp:
442 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
443 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
444 array in cases where we did not match.
445 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
446 "global", "ignoreCase", "multiline", and "source".
448 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
449 string into undefined rather than an empty string. For the slice method, handle an
450 undefined parameter for the limit properly as decribed in the specification, and add
451 the limit to one case that didn't have the limit at all. For the methods that generate
452 HTML strings, use lowercase tags instead of uppercase.
455 (KJS::UChar::toLower): Use u_tolower from the ICU library.
456 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
457 (KJS::UString::append): Fix some math that caused a buffer overflow.
458 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
459 flag) rather than converting them all to 0.
460 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
462 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
464 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
465 the Unicode specification in a few cases where it was wrong before.
466 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
467 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
468 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
469 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
470 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
471 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
472 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
473 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
474 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
476 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
478 * kjs/number_object.lut.h: Regenerated.
480 2004-08-09 Darin Adler <darin@apple.com>
484 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
486 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
487 we get a buffer overflow.
491 2004-08-05 Richard Williamson <rjw@apple.com>
493 Fixed part of 3674747. The QT guys need this for feature freeze.
495 This patch implements support for the
497 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
499 method of objects bound to JavaScript.
504 * bindings/objc/objc_class.mm:
505 (ObjcClass::methodsNamed):
506 (ObjcClass::fieldNamed):
507 * bindings/objc/objc_instance.mm:
508 (ObjcInstance::invokeMethod):
509 * bindings/objc/objc_runtime.h:
510 (KJS::Bindings::ObjcMethod::~ObjcMethod):
511 (KJS::Bindings::ObjcMethod::isFallbackMethod):
512 (KJS::Bindings::ObjcMethod::javaScriptName):
513 * bindings/objc/objc_runtime.mm:
514 (ObjcMethod::ObjcMethod):
515 (ObjcMethod::getMethodSignature):
516 (ObjcMethod::setJavaScriptName):
517 * bindings/testbindings.mm:
519 2004-08-04 Vicki Murley <vicki@apple.com>
523 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
526 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
527 go to the next line and continue parsing the string (instead of failing). This matches
528 behavior in Mac IE and Mozilla.
530 2004-08-03 Kevin Decker <kdecker@apple.com>
534 Rolled in changes from the latest KJS sources that support additional
535 Number.prototype functions.
537 Specifically this patch covers the follow parts of the ECMA 3 spec:
538 15.7.4.5, 15.7.4.6, and 15.7.4.7
541 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
542 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
543 <rdar://problem/3749591> missing Number.toExponential prototype implementation
545 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
546 list of supported identifiers (a macro).
547 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
549 (NumberPrototypeImp::NumberPrototypeImp):
550 (NumberProtoFuncImp::call):
551 * kjs/number_object.h: Added property names for toFixed, toPrecision,
553 (KJS::NumberProtoFuncImp::):
554 * tests/mozilla/expected.html: Update results.
556 2004-08-03 Darin Adler <darin@apple.com>
560 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
562 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
563 we are supposed to just copy the regular expression object, and do so.
564 Also tighten up arguments check to handle case where an actual "undefined"
565 is passed rather than just omitting an argument.
567 * tests/mozilla/expected.html: Update results.
569 2004-08-02 Darin Adler <darin@apple.com>
571 * tests/mozilla/.cvsignore: Added.
572 * tests/mozilla/expected.html: Update results.
574 2004-08-02 Darin Adler <darin@apple.com>
578 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
580 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
581 Append the flags here so more tests paseed.
583 2004-08-02 Darin Adler <darin@apple.com>
587 - fixed a couple things making 5 Mozilla regexp tests pass
589 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
591 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
592 be used as the flags string when no parameter was passed.
594 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
595 Added a class info object for RegExp prototype so it can return
596 a string instead of raising an exception when converting to a string.
598 * tests/mozilla/expected.html: Update results.
600 2004-08-02 Darin Adler <darin@apple.com>
604 - fix crashes in mozilla tests due to mishandling NaN
606 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
607 calls to toInteger so that NaN will get turned into something that fits in an integer.
608 These were the ones John already fixed, but his fix used isnan and the new fix is
611 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
612 after a call to toInteger to handle NaN properly. Also removed separate check
613 for undefined that's not needed.
615 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
616 as in the above two files, but for a lot more functions. Also changed one place with
617 an explicit check for undefined to instead just check isNaN.
619 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
620 like me who don't keep $SYMROOTS in their $PATH.
626 2004-07-26 Kevin Decker <kdecker@apple.com>
628 Changes done by Darin, reviewed by Kevin.
630 - changed testkjs to build in Xcode rather than from Makefile
632 * .cvsignore: Removed obsolete files from this list.
633 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
634 Changed to build target "All" rather than default target. This makes us
635 build the testkjs test tool.
636 * dummy.cpp: Removed.
637 * kjs/.cvsignore: Removed obsolete files from this list, including
638 the testkjs tool, which is now built in the symroots directory.
639 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
640 changed this file. Also this has the nice side effect of causing the tool
641 to be rebuilt in the new location even if there are no other changes in
642 your tree when you check this out.
643 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
644 without setting the execute bit on jsDriver.pl.
646 2004-07-22 Kevin Decker <kdecker@apple.com>
650 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
652 * kjs/function_object.cpp:
653 (FunctionObjectImp::construct):
654 * kjs/function_object.h:
656 (KJS::ObjectImp::construct):
658 (KJS::Object::construct):
660 2004-07-21 Darin Adler <darin@apple.com>
662 * bindings/npruntime.h: Fixed typo.
664 2004-07-19 John Sullivan <sullivan@apple.com>
668 - bulletproofed array.slice() against NAN arguments. Harri noticed this
669 vulnerability in my patch for 3714644
671 * kjs/array_object.cpp:
672 (ArrayProtoFuncImp::call):
673 handle NAN parameters passed to slice() by clamping to 0 and length.
675 2004-07-19 Richard Williamson <rjw@apple.com>
677 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
682 * bindings/jni/jni_jsobject.cpp:
684 (JSObject::JSObject):
686 2004-07-16 John Sullivan <sullivan@apple.com>
690 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
691 hangs browser with javascript
693 * kjs/array_object.cpp:
694 (ArrayProtoFuncImp::call):
695 Check for undefined type for args[0] the same way we were already checking
696 for args[1]. In this case, args was zero-length, but we were treating
697 args[0] like an integer anyway. Resulted in some code looping from a NAN
698 value to 4, taking approximately forever.
700 * JavaScriptCore.pbproj/project.pbxproj:
705 2004-07-14 Maciej Stachowiak <mjs@apple.com>
709 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
710 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
712 * kjs/number_object.cpp:
713 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
715 2004-07-13 Kevin Decker <kdecker@apple.com>
717 Reviewed by kocienda.
719 - made testkjs and JavaScriptCore a subtarget of 'All'
720 - testkjs now builds in $SYMROOTS
722 * JavaScriptCore.pbproj/project.pbxproj:
726 2004-06-24 Chris Blumenberg <cblu@apple.com>
728 Ignore .mode1 files in JavaScriptCore.pbproj
730 Reviewed by kocienda.
732 * JavaScriptCore.pbproj/.cvsignore:
734 2004-06-23 Richard Williamson <rjw@apple.com>
736 Implemented changes for latest npruntime.h.
740 * JavaScriptCore.pbproj/project.pbxproj:
741 * bindings/NP_jsobject.cpp:
742 (listFromVariantArgs):
743 (identiferFromNPIdentifier):
744 (_NPN_CreateScriptObject):
749 (NPN_RemoveProperty):
750 * bindings/NP_jsobject.h:
751 * bindings/c/c_class.cpp:
752 (CClass::methodsNamed):
753 (CClass::fieldNamed):
754 * bindings/c/c_instance.cpp:
755 (CInstance::invokeMethod):
756 * bindings/c/c_utility.cpp:
757 (convertNPVariantToValue):
758 * bindings/c/c_utility.h:
759 * bindings/npruntime.cpp:
760 (stringIdentifierEqual):
761 (stringIdentifierHash):
762 (getStringIdentifierDictionary):
763 (intIdentifierEqual):
765 (getIntIdentifierDictionary):
766 (NPN_GetStringIdentifier):
767 (NPN_GetStringIdentifiers):
768 (NPN_GetIntIdentifier):
769 (NPN_IdentifierIsString):
770 (NPN_UTF8FromIdentifier):
771 (NPN_VariantToInt32):
772 (NPN_VariantToDouble):
774 * bindings/npruntime.h:
775 * bindings/objc/WebScriptObject.mm:
776 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
777 * bindings/runtime_object.cpp:
778 (RuntimeObjectImp::~RuntimeObjectImp):
779 * bindings/runtime_root.cpp:
780 (KJS::Bindings::rootForInterpreter):
781 * bindings/testbindings.cpp:
782 (initializeIdentifiers):
788 === JavaScriptCore-146.1 ===
790 2004-06-16 Richard Williamson <rjw@apple.com>
792 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
794 This turned out to be a show stopper for Dashboard. Accessing a nil
795 ObjC property from JS caused a crash. Similar to the problem
800 * bindings/objc/objc_runtime.mm:
801 (KJS::Bindings::ObjcField::valueFromInstance):
805 2004-06-16 Richard Williamson <rjw@apple.com>
807 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
809 This turned out to be a show stopper for Dashboard. We now
810 return Undefined() when nil is returned from a ObjC method
811 that returns an object type.
815 * bindings/objc/objc_utility.mm:
816 (KJS::Bindings::convertObjcValueToValue):
820 2004-06-15 Richard Williamson <rjw@apple.com>
822 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
824 No longer need to check respondsToSelector: for
825 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
826 because these now have a default implementation on NSObject.
830 * bindings/objc/objc_class.mm:
831 (ObjcClass::methodsNamed):
832 (ObjcClass::fieldNamed):
834 2004-06-14 Darin Adler <darin@apple.com>
838 - fixed some things for GC that Patrick missed, or that happened after the branch
840 * bindings/objc/WebScriptObject.mm:
841 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
842 (-[WebScriptObject finalize]): Added.
844 - added some missing nil checks
846 * bindings/objc/objc_instance.mm:
847 (ObjcInstance::ObjcInstance): Check for nil.
848 (ObjcInstance::~ObjcInstance): Check for nil.
849 (ObjcInstance::operator=): Check for nil.
851 2004-06-14 Darin Adler <darin@apple.com>
853 Reviewed by me, code changes by Patrick Beard.
855 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
857 * bindings/objc/objc_instance.mm:
858 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
859 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
860 (ObjcInstance::operator=): More of the same.
861 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
863 * bindings/objc/objc_runtime.mm:
864 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
865 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
866 (ObjcArray::operator=): More of the same.
868 * bindings/testbindings.mm: Fixed incorrect license.
869 (main): Use [pool drain] if compiling on Tiger.
873 2004-06-10 Kevin Decker <kdecker@apple.com>
879 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
881 (KJS::Lexer::lineNo):
882 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
884 === JavaScriptCore-143.2 ===
886 2004-06-07 Darin Adler <darin@apple.com>
888 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
890 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
891 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
893 === JavaScriptCore-143.1 ===
895 2004-06-04 Kevin Decker <kdecker@apple.com>
899 - fixed <rdar://problem/3680594>
902 (KJS::Error::create):
906 2004-06-04 Darin Adler <darin@apple.com>
908 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
910 2004-06-04 Kevin Decker <kdecker@apple.com>
914 - ObjC bindings do not (yet) pass along sourceurl or line numbers
915 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
916 - changed the wording of an error message
917 - the lexer, parser, and interpreter have been made "sourceURL aware"
918 - stored the url into Error
920 * bindings/NP_jsobject.cpp:
922 * bindings/jni/jni_jsobject.cpp:
924 * bindings/objc/WebScriptObject.mm:
925 (-[WebScriptObject evaluateWebScript:]):
927 (GlobalFuncImp::call):
928 * kjs/function_object.cpp:
929 (FunctionObjectImp::construct):
932 (InterpreterImp::checkSyntax):
933 (InterpreterImp::evaluate):
935 * kjs/interpreter.cpp:
936 (Interpreter::evaluate):
941 (KJS::Lexer::sourceURL):
945 (FunctionCallNode::evaluate):
948 (KJS::Error::create):
951 2004-06-04 Richard Williamson <rjw@apple.com>
953 Fixed crash when attempting to access properties on nil
958 * bindings/objc/objc_instance.mm:
959 (ObjcInstance::getClass):
960 * bindings/runtime_object.cpp:
961 (RuntimeObjectImp::get):
963 * bindings/testbindings.mm:
964 (-[MyFirstInterface getString]):
966 2004-05-27 Kevin Decker <kdecker@apple.com>
970 -revised generated error message content
972 * kjs/error_object.cpp:
973 (ErrorProtoFuncImp::call):
977 (KJS::Error::create):
981 2004-05-27 Richard Williamson <rjw@apple.com>
983 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
987 * bindings/objc/WebScriptObject.h:
989 2004-05-27 Darin Adler <darin@apple.com>
993 - moved to new symlink technique for embedding frameworks
995 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
996 because we don't need it any more.
998 2004-05-24 Richard Williamson <rjw@apple.com>
1000 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
1001 fixed ClassInfo to correctly reflect inheritance. This is required
1002 because of the runtime checks in JSC for arrays, i.e. in
1003 the Function objects apply method.
1007 * bindings/jni/jni_runtime.cpp:
1008 (JavaArray::convertJObjectToArray):
1009 * bindings/objc/objc_utility.mm:
1010 (KJS::Bindings::convertObjcValueToValue):
1011 * bindings/runtime_array.cpp:
1012 (RuntimeArrayImp::RuntimeArrayImp):
1013 * bindings/runtime_array.h:
1014 * bindings/testM.js: Added.
1015 * bindings/testbindings.mm:
1016 (+[MyFirstInterface webScriptNameForSelector:]):
1017 (-[MyFirstInterface logMessages:]):
1018 (-[MyFirstInterface logMessage:prefix:]):
1019 (-[MyFirstInterface callJSObject::]):
1021 2004-05-22 Darin Adler <darin@apple.com>
1025 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
1027 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
1028 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
1029 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
1030 it hasn't been set explicitly.
1034 2004-05-20 Richard Williamson <rjw@apple.com>
1036 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
1037 can now be referenced like any other WebScriptObject, meaning
1038 you can do JS operations on them.
1040 All added implementation of finalizeForWebScript.
1044 * bindings/objc/WebScriptObject.h:
1045 * bindings/objc/WebScriptObject.mm:
1046 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
1047 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1048 (-[WebScriptObject KJS::]):
1049 (-[WebScriptObject dealloc]):
1050 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1051 (-[WebScriptObject evaluateWebScript:]):
1052 (-[WebScriptObject setValue:forKey:]):
1053 (-[WebScriptObject valueForKey:]):
1054 (-[WebScriptObject stringRepresentation]):
1055 * bindings/objc/WebScriptObjectPrivate.h:
1056 * bindings/objc/objc_instance.mm:
1057 (ObjcInstance::~ObjcInstance):
1059 2004-05-19 Richard Williamson <rjw@apple.com>
1061 Removed extraneous tabs that were added (by XCode?).
1063 * bindings/objc/WebScriptObject.h:
1065 2004-05-19 Darin Adler <darin@apple.com>
1067 - fixed headers with licenses mangled by Xcode auto-indenting
1069 * bindings/jni/jni_jsobject.cpp:
1070 * bindings/jni/jni_jsobject.h:
1071 * bindings/runtime_array.h:
1072 * bindings/runtime_root.cpp:
1073 * bindings/runtime_root.h:
1075 2004-05-18 Richard Williamson <rjw@apple.com>
1077 Added exception logging. Also check for exception and
1078 set results as appropriate.
1080 Reviewed by Maciej (partially reviewed).
1082 * bindings/objc/WebScriptObject.mm:
1083 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1084 (-[WebScriptObject evaluateWebScript:]):
1085 (-[WebScriptObject setValue:forKey:]):
1086 (-[WebScriptObject valueForKey:]):
1088 2004-05-18 Richard Williamson <rjw@apple.com>
1090 Finsished implementing support for windowScriptObject.
1091 Had to make WebScriptObjectPrivate.h accessible from
1096 * JavaScriptCore.pbproj/project.pbxproj:
1097 * bindings/objc/WebScriptObjectPrivate.h:
1099 2004-05-18 Richard Williamson <rjw@apple.com>
1101 Use KVC to set/get values instead of directly accessing
1106 * bindings/objc/WebScriptObject.mm:
1107 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1108 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1109 * bindings/objc/objc_runtime.mm:
1110 (ObjcField::valueFromInstance):
1111 (convertValueToObjcObject):
1112 (ObjcField::setValueToInstance):
1114 2004-05-17 Richard Williamson <rjw@apple.com>
1116 Implemented new API for WebScriptObject.
1118 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
1119 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
1123 * JavaScriptCore.pbproj/project.pbxproj:
1124 * bindings/c/c_instance.cpp:
1125 (CInstance::invokeMethod):
1126 * bindings/jni/jni_instance.cpp:
1127 (JavaInstance::invokeMethod):
1128 * bindings/jni/jni_jsobject.cpp:
1129 (JSObject::convertValueToJObject):
1130 * bindings/jni/jni_utility.cpp:
1131 (KJS::Bindings::getJNIField):
1132 * bindings/objc/WebScriptObject.mm:
1134 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1135 (-[WebScriptObject KJS::]):
1136 (-[WebScriptObject dealloc]):
1137 (+[WebScriptObject throwException:]):
1139 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1140 (-[WebScriptObject evaluateWebScript:]):
1141 (-[WebScriptObject setValue:forKey:]):
1142 (-[WebScriptObject valueForKey:]):
1143 (-[WebScriptObject stringRepresentation]):
1144 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1145 (+[WebUndefined undefined]):
1146 (-[WebUndefined initWithCoder:]):
1147 (-[WebUndefined encodeWithCoder:]):
1148 (-[WebUndefined copyWithZone:]):
1149 (-[WebUndefined retain]):
1150 (-[WebUndefined release]):
1151 (-[WebUndefined retainCount]):
1152 (-[WebUndefined autorelease]):
1153 (-[WebUndefined dealloc]):
1154 (-[WebUndefined copy]):
1155 (-[WebUndefined replacementObjectForPortCoder:]):
1156 * bindings/objc/WebScriptObjectPrivate.h: Added.
1157 * bindings/objc/objc_class.mm:
1158 (ObjcClass::methodsNamed):
1159 (ObjcClass::fieldNamed):
1160 * bindings/objc/objc_instance.mm:
1161 (ObjcInstance::invokeMethod):
1162 * bindings/objc/objc_jsobject.h:
1163 * bindings/objc/objc_jsobject.mm:
1164 * bindings/objc/objc_runtime.mm:
1165 (ObjcField::valueFromInstance):
1166 * bindings/objc/objc_utility.mm:
1167 (KJS::Bindings::JSMethodNameToObjCMethodName):
1168 (KJS::Bindings::convertValueToObjcValue):
1169 (KJS::Bindings::convertObjcValueToValue):
1170 * bindings/runtime.cpp:
1171 (Instance::setDidExecuteFunction):
1172 (Instance::didExecuteFunction):
1173 (Instance::setValueOfField):
1174 * bindings/runtime.h:
1175 * bindings/testbindings.mm:
1176 (+[MyFirstInterface webScriptNameForSelector:]):
1177 (-[MyFirstInterface callJSObject::]):
1179 2004-05-14 Vicki Murley <vicki@apple.com>
1183 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
1185 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
1189 2004-05-13 Richard Williamson <rjw@apple.com>
1196 * bindings/objc/WebScriptObject.h:
1198 2004-05-13 Richard Williamson <rjw@apple.com>
1200 Approved API changes. Currently unimplemented.
1205 * JavaScriptCore.pbproj/project.pbxproj:
1206 * bindings/objc/WebScriptObject.h: Added.
1207 * bindings/objc/WebScriptObject.mm: Added.
1208 (+[WebScriptObject throwException:]):
1209 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1210 (-[WebScriptObject evaluateWebScript:]):
1211 (-[WebScriptObject stringRepresentation]):
1212 (+[WebUndefined undefined]):
1213 (-[WebUndefined initWithCoder:]):
1214 (-[WebUndefined encodeWithCoder:]):
1215 (-[WebUndefined copyWithZone:]):
1217 2004-05-07 Vicki Murley <vicki@apple.com>
1221 Turn off GC since it uses ppc only instructions (which breaks
1224 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
1228 2004-05-07 Maciej Stachowiak <mjs@apple.com>
1232 - add -funroll-loops=16 compiler option for approx .5% speedup on
1233 HTML iBench and .5-1% speedup on JS iBench.
1235 * JavaScriptCore.pbproj/project.pbxproj:
1237 2004-04-25 Maciej Stachowiak <mjs@apple.com>
1241 Enable full conservative GC mode in addition to test mode. When
1242 conservative GC is enabled, we now get an 11% speed improvement on
1243 the iBench. Also fix some spots I missed before.
1245 Specific noteworth changes:
1247 * kjs/collector.cpp:
1248 (KJS::Collector::markStackObjectsConservatively): Check possible
1249 cell pointers for 8-byte aligment and verify they are not 0.
1251 * kjs/protected_values.cpp:
1252 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
1253 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
1255 (KJS::gcProtectNullTolerant): ...to here...
1256 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
1257 tolerance, and doing the check is expensive.
1259 * kjs/protected_values.cpp:
1260 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
1261 that is still very good.
1266 (KJS::ProtectedValue::ProtectedValue):
1267 (KJS::ProtectedValue::~ProtectedValue):
1268 (KJS::ProtectedValue::operator=):
1269 (KJS::ProtectedObject::ProtectedObject):
1270 (KJS::ProtectedObject::~ProtectedObject):
1271 (KJS::ProtectedObject::operator=):
1272 (KJS::ProtectedReference::ProtectedReference):
1273 (KJS::ProtectedReference::~ProtectedReference):
1274 (KJS::ProtectedReference::operator=):
1275 * kjs/protected_values.cpp:
1276 (KJS::ProtectedValues::getProtectCount):
1277 (KJS::ProtectedValues::increaseProtectCount):
1278 (KJS::ProtectedValues::decreaseProtectCount):
1279 (KJS::ProtectedValues::computeHash):
1280 * bindings/runtime_root.cpp:
1281 (KJS::Bindings::addNativeReference):
1282 (KJS::Bindings::removeNativeReference):
1283 (RootObject::removeAllNativeReferences):
1284 * bindings/runtime_root.h:
1285 (KJS::Bindings::RootObject::~RootObject):
1286 (KJS::Bindings::RootObject::setRootObjectImp):
1287 * kjs/collector.cpp:
1288 (KJS::Collector::allocate):
1289 (KJS::Collector::collect):
1292 (NumberImp::create):
1293 (InterpreterImp::globalInit):
1294 (InterpreterImp::globalClear):
1295 (InterpreterImp::mark):
1297 (KJS::List::derefValues):
1298 (KJS::List::refValues):
1299 (KJS::List::append):
1301 (KJS::ObjectImp::setInternalValue):
1302 (KJS::ObjectImp::putDirect):
1307 (KJS::ValueImp::ValueImp):
1308 (KJS::ValueImp::~ValueImp):
1310 (KJS::Value::Value):
1311 (KJS::Value::~Value):
1312 (KJS::Value::operator=):
1314 2004-04-30 Richard Williamson <rjw@apple.com>
1316 Asking an NSInvocation for it's return value when return type
1317 is void throws an exception. Added check for void return types
1318 to avoid this exception.
1322 * bindings/objc/objc_instance.mm:
1323 (ObjcInstance::invokeMethod):
1325 2004-04-29 Richard Williamson <rjw@apple.com>
1327 Fixed several bad problems with the ObjC bindings. In particular, conversion
1328 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
1332 * bindings/objc/objc_jsobject.h:
1333 * bindings/objc/objc_jsobject.mm:
1334 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
1335 (-[JavaScriptObject KJS::]):
1336 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1337 (-[JavaScriptObject call:arguments:]):
1338 (-[JavaScriptObject evaluate:]):
1339 (-[JavaScriptObject getMember:]):
1340 (-[JavaScriptObject getSlot:]):
1341 * bindings/objc/objc_runtime.mm:
1342 (ObjcField::valueFromInstance):
1343 (ObjcField::setValueToInstance):
1344 * bindings/objc/objc_utility.mm:
1345 (KJS::Bindings::convertValueToObjcValue):
1346 (KJS::Bindings::convertObjcValueToValue):
1347 * bindings/runtime.h:
1348 * bindings/runtime_root.cpp:
1349 (KJS::Bindings::rootForInterpreter):
1350 (KJS::Bindings::addNativeReference):
1351 (KJS::Bindings::removeNativeReference):
1352 * bindings/runtime_root.h:
1353 * bindings/testbindings.mm:
1354 (-[MyFirstInterface logMessage:]):
1355 (-[MyFirstInterface setJSObject:]):
1356 (-[MyFirstInterface callJSObject::]):
1358 2004-04-24 Darin Adler <darin@apple.com>
1362 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
1365 2004-04-23 Maciej Stachowiak <mjs@apple.com>
1369 Implementation of conservative GC, based partly on code from
1370 Darin. It's turned off for now, so it shouldn't have any effect on
1373 * JavaScriptCore.pbproj/project.pbxproj:
1374 * kjs/collector.cpp:
1375 (KJS::Collector::markStackObjectsConservatively):
1376 (KJS::Collector::markProtectedObjects):
1377 (KJS::Collector::collect):
1382 * kjs/protected_values.cpp: Added.
1383 (KJS::ProtectedValues::getProtectCount):
1384 (KJS::ProtectedValues::increaseProtectCount):
1385 (KJS::ProtectedValues::insert):
1386 (KJS::ProtectedValues::decreaseProtectCount):
1387 (KJS::ProtectedValues::expand):
1388 (KJS::ProtectedValues::shrink):
1389 (KJS::ProtectedValues::rehash):
1390 (KJS::ProtectedValues::computeHash):
1391 * kjs/protected_values.h: Added.
1393 (ValueImp::useConservativeMark):
1401 2004-04-22 Richard Williamson <rjw@apple.com>
1403 Fixed build snafu (re-declaration of NPBool in npruntime.h and
1406 * bindings/npruntime.h:
1408 2004-04-22 Richard Williamson <rjw@apple.com>
1410 Updated plugin binding API to reflect latest revision from
1413 Biggest change is the introduction of NPVariant used to represent
1414 value types. NPVariant replaces the use of NPObject for the
1415 exchange of values between scripting environment and native code.
1419 * JavaScriptCore.pbproj/project.pbxproj:
1420 * bindings/NP_jsobject.cpp:
1421 (identiferFromNPIdentifier):
1427 (NPN_GetPropertyAtIndex):
1428 (NPN_SetPropertyAtIndex):
1429 * bindings/c/c_class.cpp:
1430 (CClass::methodsNamed):
1431 (CClass::fieldNamed):
1432 * bindings/c/c_instance.cpp:
1433 (CInstance::invokeMethod):
1434 (CInstance::defaultValue):
1435 * bindings/c/c_runtime.cpp:
1436 (CField::valueFromInstance):
1437 (CField::setValueToInstance):
1438 * bindings/c/c_utility.cpp:
1439 (convertNPStringToUTF16):
1440 (convertUTF8ToUTF16):
1441 (coerceValueToNPVariantStringType):
1442 (convertValueToNPVariant):
1443 (convertNPVariantToValue):
1444 * bindings/c/c_utility.h:
1445 * bindings/npruntime.cpp:
1446 (NPN_GetIdentifier):
1447 (NPN_GetIdentifiers):
1448 (NPN_UTF8FromIdentifier):
1449 (NPN_VariantIsVoid):
1450 (NPN_VariantIsNull):
1451 (NPN_VariantIsUndefined):
1452 (NPN_VariantIsBool):
1453 (NPN_VariantIsInt32):
1454 (NPN_VariantIsDouble):
1455 (NPN_VariantIsString):
1456 (NPN_VariantIsObject):
1457 (NPN_VariantToBool):
1458 (NPN_VariantToString):
1459 (NPN_VariantToInt32):
1460 (NPN_VariantToDouble):
1461 (NPN_VariantToObject):
1462 (NPN_InitializeVariantAsVoid):
1463 (NPN_InitializeVariantAsNull):
1464 (NPN_InitializeVariantAsUndefined):
1465 (NPN_InitializeVariantWithBool):
1466 (NPN_InitializeVariantWithInt32):
1467 (NPN_InitializeVariantWithDouble):
1468 (NPN_InitializeVariantWithString):
1469 (NPN_InitializeVariantWithStringCopy):
1470 (NPN_InitializeVariantWithObject):
1471 (NPN_InitializeVariantWithVariant):
1472 (NPN_ReleaseVariantValue):
1475 (NPN_ReleaseObject):
1476 (NPN_IsKindOfClass):
1477 (NPN_SetExceptionWithUTF8):
1479 * bindings/npruntime.h:
1481 (_NPString::_NPVariant::):
1482 * bindings/testbindings.cpp:
1497 2004-04-22 Darin Adler <darin@apple.com>
1501 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
1504 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
1505 Was resulting in a buffer 2x the needed size.
1506 (KJS::UString::expandPreCapacity): Ditto.
1507 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
1509 2004-04-21 Maciej Stachowiak <mjs@apple.com>
1513 Preliminary change for conservative GC. Create "protected"
1514 subclasses to GC-protect objects when on heap, since we will soon
1515 remove the built-in refcounting of the normal wrapper classes. Use
1518 * JavaScriptCore.pbproj/project.pbxproj:
1521 (KJS::InterpreterImp::globalObject):
1522 * kjs/interpreter.h:
1523 * kjs/property_map.cpp:
1525 * kjs/reference_list.cpp:
1527 2004-04-19 Maciej Stachowiak <mjs@apple.com>
1531 Optimize prepend using the shared substring optimization. Also,
1532 limit the applicability of shared append and shared prepend. If
1533 you overdo it, it does more harm than good, because you create a
1534 bunch of strings that are disqualified from future shared
1535 append/prepend, for not much immediate savings in allocate/copy
1540 (KJS::UString::Rep::create):
1541 (KJS::UString::expandedSize):
1542 (KJS::UString::usedPreCapacity):
1543 (KJS::UString::expandCapacity):
1544 (KJS::UString::expandPreCapacity):
1545 (KJS::UString::UString):
1546 (KJS::UString::append):
1547 (KJS::UString::operator=):
1549 (KJS::UString::Rep::data):
1551 2004-04-16 Maciej Stachowiak <mjs@apple.com>
1552 Reviewed by Richard.
1554 No more need for Completion or Reference to privately inherit from
1555 Value, none of the superclass functionality is used.
1562 2004-04-16 Richard Williamson <rjw@apple.com>
1564 Added interpreter lock protection around object creation.
1568 * bindings/runtime.cpp:
1569 (Instance::createRuntimeObject):
1571 2004-04-16 Maciej Stachowiak <mjs@apple.com>
1575 Another JavaScript speed improvement: use the mechanism from
1576 string append optimization to make taking a substring fast, again
1579 A further 22% improvement on the 24fun string speed test.
1583 (KJS::UString::Rep::create):
1584 (KJS::UString::UString):
1585 (KJS::UString::append):
1586 (KJS::UString::operator=):
1587 (KJS::UString::substr):
1589 (KJS::UString::Rep::data):
1591 2004-04-13 Maciej Stachowiak <mjs@apple.com>
1595 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
1596 - fixed <rdar://problem/3600691>: Table generation test is really slow
1597 - fixed <rdar://problem/3600661>: 24fun date test is really slow
1599 80% speedup on the string test, lesser speedups on the other two.
1601 Two different optimizations here:
1603 1) Avoid large overhead of scanning strings to see if they are all
1604 ASCII before numeric conversion.
1607 (AssignNode::evaluate): Don't convert to integer until we know for
1608 sure the operation will need it. Attempting to convert strings to
1609 numbers is a waste when they are being appended with +=.
1611 2) Avoid huge cost of appending strings.
1613 This is done by allowing multiple strings to share a buffer but
1614 actually use different ranges of it. The first time a string is
1615 appended to, we start leaving at least 10% extra space in the
1616 buffer, so doing N appends to the same string takes O(log N)
1617 mallocs instead of O(N).
1619 * kjs/identifier.cpp:
1620 (KJS::Identifier::equal):
1621 (KJS::Identifier::add):
1624 (KJS::UCharReference::operator=):
1625 (KJS::UCharReference::ref):
1626 (KJS::UString::Rep::create):
1627 (KJS::UString::Rep::destroy):
1628 (KJS::UString::expandedSize):
1629 (KJS::UString::usedCapacity):
1630 (KJS::UString::expandCapacity):
1631 (KJS::UString::UString):
1632 (KJS::UString::null):
1633 (KJS::UString::append):
1634 (KJS::UString::operator=):
1635 (KJS::UString::toStrictUInt32):
1636 (KJS::UString::detach):
1637 (KJS::KJS::operator==):
1639 (KJS::UString::Rep::data):
1640 (KJS::UString::Rep::hash):
1642 2004-04-09 Maciej Stachowiak <mjs@apple.com>
1646 - fix deployment build by avoiding deployment-only warning.
1648 * kjs/scope_chain.cpp:
1649 (KJS::ScopeChain::bottom):
1651 2004-04-09 Maciej Stachowiak <mjs@apple.com>
1655 Changed things so that newly created objects get a prototype based
1656 on the scope chain of the current function, rather than the
1657 interpreter that started execution. This fixes the following bugs:
1659 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
1660 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
1662 * JavaScriptCore.pbproj/project.pbxproj:
1663 * kjs/array_object.cpp:
1664 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1665 (ArrayProtoFuncImp::ArrayProtoFuncImp):
1666 (ArrayProtoFuncImp::call):
1667 (ArrayObjectImp::construct):
1668 * kjs/bool_object.cpp:
1669 (BooleanObjectImp::construct):
1670 * kjs/date_object.cpp:
1671 (DateProtoFuncImp::DateProtoFuncImp):
1672 (DateProtoFuncImp::call):
1673 (DateObjectImp::construct):
1674 * kjs/error_object.cpp:
1675 (ErrorObjectImp::construct):
1677 (FunctionImp::FunctionImp):
1678 (FunctionImp::call):
1679 (DeclaredFunctionImp::construct):
1680 (ArgumentsImp::ArgumentsImp):
1681 (GlobalFuncImp::call):
1682 * kjs/function_object.cpp:
1683 (FunctionProtoFuncImp::call):
1684 (FunctionObjectImp::construct):
1686 (BooleanImp::toObject):
1687 (StringImp::toObject):
1688 (NumberImp::toObject):
1689 (InterpreterImp::InterpreterImp):
1690 (InterpreterImp::clear):
1691 (InterpreterImp::interpreterWithGlobalObject):
1693 * kjs/interpreter.cpp:
1694 (ExecState::lexicalInterpreter):
1695 * kjs/interpreter.h:
1696 (KJS::ExecState::dynamicInterpreter):
1697 (KJS::ExecState::interpreter):
1698 * kjs/math_object.cpp:
1699 (MathFuncImp::MathFuncImp):
1701 (StatementNode::hitStatement):
1702 (StatementNode::abortStatement):
1703 (RegExpNode::evaluate):
1704 (ElementNode::evaluate):
1705 (ArrayNode::evaluate):
1706 (ObjectLiteralNode::evaluate):
1707 (PropertyValueNode::evaluate):
1708 (FunctionCallNode::evaluate):
1709 (FuncDeclNode::processFuncDecl):
1710 (FuncExprNode::evaluate):
1711 * kjs/number_object.cpp:
1712 (NumberObjectImp::construct):
1714 (KJS::ObjectImp::defaultValue):
1715 (KJS::Error::create):
1716 * kjs/object_object.cpp:
1717 (ObjectObjectImp::construct):
1718 * kjs/reference.cpp:
1719 (Reference::putValue):
1720 * kjs/regexp_object.cpp:
1721 (RegExpProtoFuncImp::call):
1722 (RegExpObjectImp::arrayOfMatches):
1723 (RegExpObjectImp::construct):
1724 * kjs/scope_chain.cpp:
1725 (KJS::ScopeChain::bottom):
1726 * kjs/scope_chain.h:
1727 * kjs/string_object.cpp:
1728 (StringProtoFuncImp::StringProtoFuncImp):
1729 (StringProtoFuncImp::call):
1730 (StringObjectImp::construct):
1736 2004-03-31 Richard Williamson <rjw@apple.com>
1738 Tedious renames based on feedback from plugin-futures list.
1739 NP_ functions are renamed with NPN_ prefix.
1740 Types prefix renamed from NP_ to NP.
1741 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
1743 No review because this was just a renaming patch.
1745 * bindings/NP_jsobject.cpp:
1748 (identiferFromNPIdentifier):
1753 (NPN_RemoveProperty):
1755 (NPN_GetPropertyAtIndex):
1756 (NPN_SetPropertyAtIndex):
1757 * bindings/NP_jsobject.h:
1758 * bindings/c/c_class.cpp:
1759 (CClass::_commonInit):
1760 (CClass::classForIsA):
1762 (CClass::methodsNamed):
1763 (CClass::fieldNamed):
1764 * bindings/c/c_class.h:
1765 * bindings/c/c_instance.cpp:
1766 (CInstance::CInstance):
1767 (CInstance::~CInstance):
1768 (CInstance::operator=):
1769 (CInstance::invokeMethod):
1770 (CInstance::defaultValue):
1771 * bindings/c/c_instance.h:
1772 (KJS::Bindings::CInstance::getObject):
1773 * bindings/c/c_runtime.cpp:
1774 (CField::valueFromInstance):
1775 (CField::setValueToInstance):
1776 * bindings/c/c_runtime.h:
1777 (KJS::Bindings::CField::CField):
1778 (KJS::Bindings::CField::name):
1779 (KJS::Bindings::CMethod::CMethod):
1780 (KJS::Bindings::CMethod::name):
1781 * bindings/c/c_utility.cpp:
1782 (coerceValueToNPString):
1783 (convertValueToNPValueType):
1784 (convertNPValueTypeToValue):
1785 * bindings/c/c_utility.h:
1786 * bindings/npruntime.cpp:
1787 (NPN_IdentifierFromUTF8):
1788 (NPN_IsValidIdentifier):
1789 (NPN_GetIdentifiers):
1790 (NPN_UTF8FromIdentifier):
1793 (NPN_ReleaseObject):
1794 (NPN_IsKindOfClass):
1795 (NPN_SetExceptionWithUTF8):
1798 (NPN_CreateNumberWithInt):
1799 (NPN_CreateNumberWithFloat):
1800 (NPN_CreateNumberWithDouble):
1801 (NPN_IntFromNumber):
1802 (NPN_FloatFromNumber):
1803 (NPN_DoubleFromNumber):
1805 (NPN_CreateStringWithUTF8):
1806 (NPN_CreateStringWithUTF16):
1807 (NPN_DeallocateUTF8):
1808 (NPN_UTF8FromString):
1809 (NPN_UTF16FromString):
1812 (NPN_CreateBoolean):
1813 (NPN_BoolFromBoolean):
1816 (undefinedAllocate):
1822 (NPN_ObjectAtIndex):
1823 * bindings/npruntime.h:
1824 * bindings/runtime.cpp:
1825 (Instance::createBindingForLanguageInstance):
1826 * bindings/testbindings.cpp:
1827 (initializeIdentifiers):
1847 2004-03-31 Richard Williamson <rjw@apple.com>
1849 Changed references to NP_runtime.h to npruntime.h
1851 * JavaScriptCore.pbproj/project.pbxproj:
1852 * bindings/NP_jsobject.h:
1853 * bindings/c/c_class.h:
1854 * bindings/c/c_instance.h:
1855 * bindings/c/c_runtime.h:
1856 * bindings/c/c_utility.h:
1857 * bindings/npruntime.cpp:
1859 2004-03-31 Richard Williamson <rjw@apple.com>
1861 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
1863 * JavaScriptCore.pbproj/project.pbxproj:
1864 * bindings/NP_jsobject.h:
1865 * bindings/npruntime.cpp:
1869 2004-03-23 Richard Williamson <rjw@apple.com>
1871 Added implementation of KJS::Value <-> NP_Object conversion functions.
1872 Augmented test program for 'C' bindings.
1873 Added asserts and parameter checking to all public API.
1877 * JavaScriptCore.pbproj/project.pbxproj:
1878 * bindings/NP_jsobject.cpp:
1880 * bindings/NP_jsobject.h: Added.
1881 * bindings/NP_runtime.cpp:
1882 (NP_IdentifierFromUTF8):
1883 (NP_IsValidIdentifier):
1884 (NP_GetIdentifiers):
1889 (NP_SetExceptionWithUTF8):
1892 (NP_FloatFromNumber):
1893 (NP_DoubleFromNumber):
1894 (NP_CreateStringWithUTF8):
1895 (NP_CreateStringWithUTF16):
1896 (NP_DeallocateUTF8):
1897 (NP_UTF8FromString):
1898 (NP_UTF16FromString):
1900 (NP_BoolFromBoolean):
1901 * bindings/NP_runtime.h:
1902 * bindings/c/c_instance.cpp:
1903 (CInstance::invokeMethod):
1904 * bindings/c/c_utility.cpp:
1905 (coerceValueToNPString):
1906 (convertValueToNPValueType):
1907 (convertNPValueTypeToValue):
1908 * bindings/c/c_utility.h:
1910 * bindings/testC.js: Added.
1911 * bindings/testbindings.cpp:
1921 (myInterfaceInvoke):
1922 (myInterfaceAllocate):
1926 2004-03-19 Darin Adler <darin@apple.com>
1930 - fixed problem with methods like setUTCHour
1932 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
1933 GMT vs. local time function based on the utc flag.
1935 2004-03-17 Richard Williamson <rjw@apple.com>
1937 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
1941 * bindings/NP_jsobject.cpp:
1946 (NP_GetPropertyAtIndex):
1947 * bindings/NP_runtime.h:
1949 2004-03-16 Richard Williamson <rjw@apple.com>
1951 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.
1955 * bindings/jni/jni_class.cpp:
1956 (JavaClass::methodsNamed):
1958 2004-03-15 Richard Williamson <rjw@apple.com>
1960 Fixed 3570854. Don't attempt to convert Null to strings. We
1961 were incorrectly converting to "Null".
1963 Actually fixed by Scott Kovatch.
1965 Reviewed by Richard.
1967 * bindings/jni/jni_utility.cpp:
1968 (KJS::Bindings::convertValueToJValue):
1972 2004-03-11 Richard Williamson <rjw@apple.com>
1974 Stitched together the NP stuff to our language independent
1975 JavaScript binding stuff. Very close to being done.
1977 Added program to test C bindings (and NP stuff). Just tests
1978 properties. Will add methods and JavaScript access, etc.
1980 Updated Makefile.am to account for new bindings/c directory.
1982 Change NP_UTF8 from "const char *" to "char" to allow for
1983 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
1986 Added NP_IsValidIdentifier().
1990 * JavaScriptCore.pbproj/project.pbxproj:
1992 * bindings/NP_jsobject.cpp:
1993 (identiferFromNPIdentifier):
1995 * bindings/NP_runtime.cpp:
1996 (NP_IdentifierFromUTF8):
1997 (NP_IsValidIdentifier):
1998 (NP_GetIdentifiers):
1999 (NP_UTF8FromIdentifier):
2000 (NP_SetExceptionWithUTF8):
2002 (NP_CreateStringWithUTF8):
2003 (NP_CreateStringWithUTF16):
2004 (NP_UTF8FromString):
2005 (NP_UTF16FromString):
2006 * bindings/NP_runtime.h:
2007 * bindings/c/c_class.cpp: Added.
2008 (CClass::_commonDelete):
2009 (CClass::_commonCopy):
2010 (CClass::_commonInit):
2011 (_createClassesByIsAIfNecessary):
2012 (CClass::classForIsA):
2015 (CClass::methodsNamed):
2016 (CClass::fieldNamed):
2017 * bindings/c/c_class.h: Added.
2018 (KJS::Bindings::CClass::~CClass):
2019 (KJS::Bindings::CClass::CClass):
2020 (KJS::Bindings::CClass::operator=):
2021 (KJS::Bindings::CClass::constructorAt):
2022 (KJS::Bindings::CClass::numConstructors):
2023 * bindings/c/c_instance.cpp: Added.
2024 (CInstance::CInstance):
2025 (CInstance::~CInstance):
2026 (CInstance::operator=):
2027 (CInstance::getClass):
2030 (CInstance::invokeMethod):
2031 (CInstance::defaultValue):
2032 (CInstance::stringValue):
2033 (CInstance::numberValue):
2034 (CInstance::booleanValue):
2035 (CInstance::valueOf):
2036 * bindings/c/c_instance.h: Added.
2037 (KJS::Bindings::CInstance::getObject):
2038 * bindings/c/c_runtime.cpp: Added.
2039 (CField::valueFromInstance):
2040 (CField::setValueToInstance):
2041 * bindings/c/c_runtime.h: Added.
2042 (KJS::Bindings::CField::CField):
2043 (KJS::Bindings::CField::name):
2044 (KJS::Bindings::CField::type):
2045 (KJS::Bindings::CMethod::CMethod):
2046 (KJS::Bindings::CMethod::name):
2047 (KJS::Bindings::CMethod::numParameters):
2048 * bindings/c/c_utility.cpp: Added.
2049 (coerceValueToNPValueType):
2050 (convertValueToNPValueType):
2051 (convertNPValueTypeToValue):
2052 * bindings/c/c_utility.h: Added.
2053 * bindings/make_testbindings:
2054 * bindings/runtime.cpp:
2055 (Instance::createBindingForLanguageInstance):
2056 * bindings/runtime.h:
2057 (KJS::Bindings::Instance::):
2058 * bindings/testbindings.cpp: Added.
2059 (initializeIdentifiers):
2060 (myInterfaceHasProperty):
2061 (myInterfaceHasMethod):
2062 (myInterfaceGetProperty):
2063 (myInterfaceSetProperty):
2064 (myInterfaceInvoke):
2065 (myInterfaceAllocate):
2066 (myInterfaceInvalidate):
2067 (myInterfaceDeallocate):
2068 (GlobalImp::className):
2069 (readJavaScriptFromFile):
2072 2004-03-10 Richard Williamson <rjw@apple.com>
2074 Made changes to support new asychronous approach to calls from
2075 plugin to JavaScript
2079 * bindings/NP_jsobject.cpp:
2084 (NP_GetPropertyAtIndex):
2085 * bindings/NP_runtime.h:
2086 * bindings/make_testbindings:
2087 * bindings/runtime.cpp:
2088 (Instance::createBindingForLanguageInstance):
2090 2004-03-10 Richard Williamson <rjw@apple.com>
2092 Updated header to include proposed changes from
2093 plugin-futures list. Calls from plugin to JavaScript
2094 are now asynchronous.
2098 * bindings/NP_runtime.h:
2102 2004-03-04 Richard Williamson <rjw@apple.com>
2104 Implementation of NP_JavaScriptObject. This is the 'C' class
2105 that wraps a JavaScript object.
2109 * JavaScriptCore.pbproj/project.pbxproj:
2110 * bindings/NP_jsobject.cpp: Added.
2111 (coerceValueToNPValueType):
2112 (convertValueToNPValueType):
2113 (convertNPValueTypeToValue):
2117 (identiferFromNPIdentifier):
2122 (NP_RemoveProperty):
2124 (NP_GetPropertyAtIndex):
2125 (NP_SetPropertyAtIndex):
2126 * bindings/NP_runtime.cpp:
2128 * bindings/NP_runtime.h:
2129 * bindings/runtime_object.h:
2131 2004-03-04 Richard Williamson <rjw@apple.com>
2133 Added NP_Array implementation.
2135 Changed NP_Boolean to just depend on two static instances, no
2136 space is required for values.
2140 * bindings/NP_runtime.cpp:
2142 (NP_BoolFromBoolean):
2148 * bindings/NP_runtime.h:
2150 2004-03-03 Darin Adler <darin@apple.com>
2154 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
2155 copyright string, and that's all that was in here.
2156 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
2158 2004-03-03 Richard Williamson <rjw@apple.com>
2160 More 'C' binding implementation. Fleshed out all the
2161 'primitive' data types.
2165 * bindings/NP_runtime.cpp:
2170 (NP_CreateStringWithUTF8):
2171 (NP_CreateStringWithUTF16):
2172 (NP_UTF8FromString):
2173 (NP_UTF16FromString):
2176 (booleanDeallocate):
2178 (NP_BoolFromBoolean):
2182 (undefinedAllocate):
2183 (undefinedDeallocate):
2185 * bindings/NP_runtime.h:
2187 2004-03-03 Richard Williamson <rjw@apple.com>
2189 More 'C' binding implementation.
2193 * bindings/NP_runtime.cpp:
2196 (getIdentifierDictionary):
2197 (NP_IdentifierFromUTF8):
2198 (NP_UTF8FromIdentifier):
2203 (NP_CreateNumberWithInt):
2204 (NP_CreateNumberWithFloat):
2205 (NP_CreateNumberWithDouble):
2207 (NP_FloatFromNumber):
2208 (NP_DoubleFromNumber):
2209 * bindings/NP_runtime.h:
2211 2004-03-02 Richard Williamson <rjw@apple.com>
2213 Removed retain/release from NP_Class. Classes will not be allowed to implement their
2214 own customer retain/release scheme.
2218 * bindings/NP_runtime.cpp:
2221 * bindings/NP_runtime.h:
2223 2004-03-02 Richard Williamson <rjw@apple.com>
2225 C binding API. Partial implementation.
2227 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.
2229 Factored root object reference counting scheme. It is now useful independent
2234 * JavaScriptCore.pbproj/project.pbxproj:
2235 * bindings/NP_runtime.cpp: Added.
2236 (NP_IdentifierFromUTF8):
2237 (NP_GetIdentifiers):
2238 (NP_UTF8FromIdentifier):
2248 (NP_RemoveProperty):
2250 (NP_GetPropertyAtIndex):
2251 (NP_SetPropertyAtIndex):
2252 (NP_CreateNumberWithInt):
2253 (NP_CreateNumberWithFloat):
2254 (NP_CreateNumberWithDouble):
2256 (NP_FloatFromNumber):
2257 (NP_DoubleFromNumber):
2258 (NP_CreateStringWithUTF8):
2259 (NP_CreateStringWithUTF16):
2260 (NP_UTF8FromString):
2261 (NP_UTF16FromString):
2263 (NP_BoolFromBoolean):
2269 * bindings/NP_runtime.h: Added.
2270 * bindings/jni/jni_jsobject.cpp:
2272 (JSObject::finalize):
2273 (JSObject::createNative):
2274 (JSObject::convertValueToJObject):
2275 * bindings/jni/jni_jsobject.h:
2276 * bindings/objc/objc_jsobject.h:
2277 * bindings/objc/objc_jsobject.mm:
2279 (windowJavaScriptObject):
2280 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2281 (-[JavaScriptObject dealloc]):
2282 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
2283 (-[JavaScriptObject call:arguments:]):
2284 (-[JavaScriptObject evaluate:]):
2285 (-[JavaScriptObject getMember:]):
2286 (-[JavaScriptObject setMember:value:]):
2287 (-[JavaScriptObject removeMember:]):
2288 (-[JavaScriptObject toString]):
2289 (-[JavaScriptObject getSlot:]):
2290 (-[JavaScriptObject setSlot:value:]):
2291 * bindings/objc/objc_utility.h:
2292 * bindings/objc/objc_utility.mm:
2293 (KJS::Bindings::convertValueToObjcValue):
2294 * bindings/runtime_root.cpp: Added.
2295 (getReferencesByRootDictionary):
2296 (getReferencesDictionary):
2297 (KJS::Bindings::findReferenceDictionary):
2298 (KJS::Bindings::rootForImp):
2299 (KJS::Bindings::addNativeReference):
2300 (KJS::Bindings::removeNativeReference):
2301 (completedJavaScriptAccess):
2302 (initializeJavaScriptAccessLock):
2303 (lockJavaScriptAccess):
2304 (unlockJavaScriptAccess):
2305 (RootObject::dispatchToJavaScriptThread):
2306 (performJavaScriptAccess):
2307 (RootObject::setFindRootObjectForNativeHandleFunction):
2308 (RootObject::removeAllNativeReferences):
2309 * bindings/runtime_root.h: Added.
2310 (KJS::Bindings::RootObject::RootObject):
2311 (KJS::Bindings::RootObject::~RootObject):
2312 (KJS::Bindings::RootObject::setRootObjectImp):
2313 (KJS::Bindings::RootObject::rootObjectImp):
2314 (KJS::Bindings::RootObject::setInterpreter):
2315 (KJS::Bindings::RootObject::interpreter):
2316 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
2317 (KJS::Bindings::RootObject::runLoop):
2318 (KJS::Bindings::RootObject::performJavaScriptSource):
2324 2004-02-18 Richard Williamson <rjw@apple.com>
2326 Added NSNumber/Number conversion.
2328 Removed some unnecessary KJS:: namespace specifiers.
2332 * bindings/objc/objc_utility.mm:
2333 (KJS::Bindings::convertValueToObjcValue):
2334 (KJS::Bindings::convertObjcValueToValue):
2335 * bindings/runtime_array.h:
2337 2004-02-18 Richard Williamson <rjw@apple.com>
2339 Added support for export NSArrays.
2341 Updated valueAt() to take an ExecState so we can throw
2344 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
2345 ObjectiveC classes to control the visibility of their methods in
2350 * bindings/jni/jni_runtime.cpp:
2351 (JavaField::valueFromInstance):
2352 (JavaArray::valueAt):
2353 * bindings/jni/jni_runtime.h:
2354 * bindings/objc/objc_class.mm:
2355 (ObjcClass::methodsNamed):
2356 * bindings/objc/objc_runtime.h:
2357 (KJS::Bindings::ObjcArray::getObjcArray):
2358 * bindings/objc/objc_runtime.mm:
2359 (ObjcField::valueFromInstance):
2360 (ObjcField::setValueToInstance):
2361 (ObjcArray::ObjcArray):
2362 (ObjcArray::~ObjcArray):
2363 (ObjcArray::operator=):
2364 (ObjcArray::setValueAt):
2365 (ObjcArray::valueAt):
2366 (ObjcArray::getLength):
2367 * bindings/objc/objc_utility.mm:
2368 (KJS::Bindings::convertValueToObjcValue):
2369 (KJS::Bindings::convertObjcValueToValue):
2370 * bindings/runtime.cpp:
2371 (Instance::getValueOfField):
2372 * bindings/runtime.h:
2373 * bindings/runtime_array.cpp:
2374 (RuntimeArrayImp::get):
2375 * bindings/runtime_object.cpp:
2376 (RuntimeObjectImp::get):
2378 2004-02-17 Richard Williamson <rjw@apple.com>
2380 Added String <-> NSString conversion.
2381 Added tests of String <-> NSString conversion to test program.
2385 * bindings/objc/objc_utility.mm:
2386 (KJS::Bindings::convertValueToObjcValue):
2387 (KJS::Bindings::convertObjcValueToValue):
2389 * bindings/testbindings.mm:
2390 (-[MyFirstInterface getString]):
2392 2004-02-15 Darin Adler <darin@apple.com>
2396 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
2397 and removing redundant settings of things that match defaults in other build styles.
2399 2004-02-13 Richard Williamson <rjw@apple.com>
2401 Work towards the JavaScript ObjC bindings. The bindings now work for
2402 simple scalar types. testbindings.mm is an illustration of how the
2407 * JavaScriptCore.pbproj/project.pbxproj:
2409 * bindings/jni/jni_class.cpp:
2410 (JavaClass::methodsNamed):
2411 * bindings/jni/jni_class.h:
2412 * bindings/jni/jni_instance.cpp:
2413 (JavaInstance::invokeMethod):
2414 * bindings/jni/jni_instance.h:
2415 * bindings/jni/jni_runtime.h:
2416 (KJS::Bindings::JavaMethod::returnType):
2417 * bindings/make_testbindings: Added.
2418 * bindings/objc/objc_class.h: Added.
2419 (KJS::Bindings::ObjcClass::~ObjcClass):
2420 (KJS::Bindings::ObjcClass::ObjcClass):
2421 (KJS::Bindings::ObjcClass::operator=):
2422 (KJS::Bindings::ObjcClass::constructorAt):
2423 (KJS::Bindings::ObjcClass::numConstructors):
2424 * bindings/objc/objc_class.mm: Added.
2425 (ObjcClass::_commonDelete):
2426 (ObjcClass::_commonCopy):
2427 (ObjcClass::_commonInit):
2428 (_createClassesByIsAIfNecessary):
2429 (ObjcClass::classForIsA):
2430 (ObjcClass::ObjcClass):
2432 (ObjcClass::methodsNamed):
2433 (ObjcClass::fieldNamed):
2434 * bindings/objc/objc_header.h: Added.
2435 * bindings/objc/objc_instance.h: Added.
2436 (KJS::Bindings::ObjcInstance::getObject):
2437 * bindings/objc/objc_instance.mm: Added.
2438 (ObjcInstance::ObjcInstance):
2439 (ObjcInstance::~ObjcInstance):
2440 (ObjcInstance::operator=):
2441 (ObjcInstance::begin):
2442 (ObjcInstance::end):
2443 (ObjcInstance::getClass):
2444 (ObjcInstance::invokeMethod):
2445 (ObjcInstance::defaultValue):
2446 (ObjcInstance::stringValue):
2447 (ObjcInstance::numberValue):
2448 (ObjcInstance::booleanValue):
2449 (ObjcInstance::valueOf):
2450 * bindings/objc/objc_jsobject.h: Added.
2451 * bindings/objc/objc_jsobject.mm: Added.
2452 * bindings/objc/objc_runtime.h:
2453 (KJS::Bindings::ObjcField::~ObjcField):
2454 (KJS::Bindings::ObjcField::ObjcField):
2455 (KJS::Bindings::ObjcField::operator=):
2456 (KJS::Bindings::ObjcMethod::ObjcMethod):
2457 (KJS::Bindings::ObjcMethod::~ObjcMethod):
2458 (KJS::Bindings::ObjcMethod::operator=):
2459 * bindings/objc/objc_runtime.mm: Added.
2460 (ObjcMethod::ObjcMethod):
2462 (ObjcMethod::numParameters):
2463 (ObjcMethod::getMethodSignature):
2464 (ObjcField::ObjcField):
2467 (ObjcField::valueFromInstance):
2468 (ObjcField::setValueToInstance):
2469 * bindings/objc/objc_utility.h: Added.
2471 * bindings/objc/objc_utility.mm: Added.
2472 (KJS::Bindings::JSMethodNameToObjCMethodName):
2473 (KJS::Bindings::convertValueToObjcValue):
2474 (KJS::Bindings::convertObjcValueToValue):
2475 (KJS::Bindings::objcValueTypeForType):
2476 * bindings/runtime.cpp:
2477 (MethodList::MethodList):
2478 (MethodList::operator=):
2479 (Instance::setValueOfField):
2480 (Instance::createBindingForLanguageInstance):
2481 (Instance::createRuntimeObject):
2482 * bindings/runtime.h:
2483 * bindings/runtime_method.cpp:
2484 (RuntimeMethodImp::RuntimeMethodImp):
2485 (RuntimeMethodImp::get):
2486 (RuntimeMethodImp::call):
2487 * bindings/runtime_method.h:
2488 * bindings/runtime_object.cpp:
2489 (RuntimeObjectImp::get):
2490 (RuntimeObjectImp::hasProperty):
2491 * bindings/test.js: Added.
2492 * bindings/testbindings.mm: Added.
2493 (-[MySecondInterface init]):
2494 (-[MyFirstInterface init]):
2495 (-[MyFirstInterface dealloc]):
2496 (+[MyFirstInterface JavaScriptNameForSelector:]):
2497 (-[MyFirstInterface getInt]):
2498 (-[MyFirstInterface setInt:]):
2499 (-[MyFirstInterface getMySecondInterface]):
2500 (-[MyFirstInterface logMessage:]):
2501 (GlobalImp::className):
2502 (readJavaScriptFromFile):
2507 2004-02-08 Darin Adler <darin@apple.com>
2511 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
2513 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
2514 macros from working right in C++ code that uses the <cctype> header.
2517 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
2518 (KJS::UTF8SequenceLengthNonASCII): Added.
2519 (KJS::inlineUTF8SequenceLength): Added.
2520 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
2521 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
2522 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
2523 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
2524 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
2526 - fixed the test program so it won't hit the interpreter lock assertion
2528 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
2532 2004-02-06 Richard Williamson <rjw@apple.com>
2534 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.
2538 * bindings/jni/jni_jsobject.cpp:
2539 (JSObject::toString):
2540 * bindings/jni/jni_utility.cpp:
2541 (KJS::Bindings::convertValueToJValue):
2543 2004-02-02 Darin Adler <darin@apple.com>
2547 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
2549 * kjs/array_object.cpp:
2550 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
2551 we start putting values in. This prevents new Array(2147483647) from causing trouble.
2552 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
2553 number is out of range. This prevents new Array(-1) from causing trouble.
2555 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
2557 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
2558 casting to int. Results now match those in other browsers.
2560 2004-02-02 Darin Adler <darin@apple.com>
2564 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
2565 - fixed other related overflow issues
2567 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
2569 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
2570 must not restrict values to the range of a particular integer type.
2571 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
2572 proper handling for negative results from fmod.
2573 (ValueImp::toUInt32): Ditto.
2574 (ValueImp::toUInt16): Ditto.
2575 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
2577 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
2578 out-of-integer-range values better in the slice function.
2579 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
2580 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
2581 out-of-integer-range values better in the toString function.
2582 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
2583 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
2584 and substr functions.
2588 2004-01-30 Richard Williamson <rjw@apple.com>
2590 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
2594 * bindings/jni/jni_instance.cpp:
2595 (JavaInstance::stringValue):
2597 2004-01-26 Darin Adler <darin@apple.com>
2599 * Makefile.am: Switch from pbxbuild to xcodebuild.
2601 2004-01-22 Richard Williamson <rjw@apple.com>
2603 Added stubs for ObjC language binding to JavaScript.
2605 * JavaScriptCore.pbproj/project.pbxproj:
2606 * bindings/jni/jni_runtime.h:
2607 * bindings/objc/objc_runtime.h: Added.
2608 (KJS::Bindings::ObjcParameter::ObjcParameter):
2609 (KJS::Bindings::ObjcParameter::~ObjcParameter):
2610 (KJS::Bindings::ObjcParameter::operator=):
2611 (KJS::Bindings::ObjcParameter::type):
2612 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
2613 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
2614 (KJS::Bindings::ObjcConstructor::_commonCopy):
2615 (KJS::Bindings::ObjcConstructor::operator=):
2616 (KJS::Bindings::ObjcConstructor::value):
2617 (KJS::Bindings::ObjcConstructor::parameterAt):
2618 (KJS::Bindings::ObjcConstructor::numParameters):
2619 (KJS::Bindings::ObjcField::ObjcField):
2620 (KJS::Bindings::ObjcField::~ObjcField):
2621 * bindings/runtime.h:
2623 2004-01-22 Richard Williamson <rjw@apple.com>
2625 Simplified JavaString by using UString as backing store. This
2626 revealed a bug in CString's assignment operator which I fixed.
2628 Removed some dead code.
2632 * bindings/jni/jni_runtime.h:
2633 (KJS::Bindings::JavaString::JavaString):
2634 (KJS::Bindings::JavaString::_commonInit):
2635 (KJS::Bindings::JavaString::UTF8String):
2636 (KJS::Bindings::JavaString::uchars):
2637 (KJS::Bindings::JavaString::length):
2638 (KJS::Bindings::JavaString::ustring):
2639 * bindings/runtime_object.cpp:
2640 (RuntimeObjectImp::RuntimeObjectImp):
2641 * bindings/runtime_object.h:
2643 (KJS::CString::CString):
2644 (KJS::CString::operator=):
2650 2004-01-16 Richard Williamson <rjw@apple.com>
2652 Fixed 3525853. We weren't handling mapping to overloaded Java
2653 methods very well. Even though this is undefined the other
2654 browsers support it. Also fixed a bug with returning arrays
2655 from Java functions.
2659 * bindings/jni/jni_class.cpp:
2660 (JavaClass::_commonInit):
2661 (JavaClass::methodsNamed):
2662 * bindings/jni/jni_class.h:
2663 * bindings/jni/jni_instance.cpp:
2664 (JavaInstance::invokeMethod):
2665 * bindings/jni/jni_instance.h:
2666 * bindings/jni/jni_runtime.cpp:
2667 (JavaArray::convertJObjectToArray):
2668 (JavaField::valueFromInstance):
2669 (JavaMethod::signature):
2670 (JavaArray::valueAt):
2671 * bindings/jni/jni_runtime.h:
2672 * bindings/jni_jsobject.cpp:
2674 (JSObject::convertJObjectToValue):
2675 * bindings/runtime.cpp:
2676 (MethodList::addMethod):
2677 (MethodList::length):
2678 (MethodList::methodAt):
2679 (MethodList::~MethodList):
2680 * bindings/runtime.h:
2681 (KJS::Bindings::MethodList::MethodList):
2682 * bindings/runtime_method.cpp:
2683 (RuntimeMethodImp::RuntimeMethodImp):
2684 (RuntimeMethodImp::get):
2685 (RuntimeMethodImp::call):
2686 * bindings/runtime_method.h:
2687 * bindings/runtime_object.cpp:
2688 (RuntimeObjectImp::get):
2689 (RuntimeObjectImp::hasProperty):
2691 2004-01-16 Richard Williamson <rjw@apple.com>
2693 Fixed 3531229. Another place that needs the Push/PopLocalFrame
2694 protection implemented for 3530401.
2698 * bindings/runtime_method.cpp:
2699 (RuntimeMethodImp::call):
2701 2004-01-15 Richard Williamson <rjw@apple.com>
2703 Fixed 3530401. JNI doesn't cleanup local refs created on the
2704 main thread. IMO this is a bad bug in our JMI implementation.
2706 To work-around the problem I explicitly delete all local refs.
2707 Further, I've added Push/PopLocalFrame calls to catch any refs
2708 that I may have missed. This will guarantee that we don't leak
2709 any Java references.
2713 * bindings/jni/jni_class.cpp:
2714 (JavaClass::_commonInit):
2715 (JavaClass::JavaClass):
2716 * bindings/jni/jni_instance.cpp:
2717 (JavaInstance::begin):
2718 (JavaInstance::end):
2719 * bindings/jni/jni_instance.h:
2720 * bindings/jni/jni_runtime.cpp:
2721 (JavaConstructor::JavaConstructor):
2722 (JavaMethod::JavaMethod):
2723 * bindings/jni_jsobject.cpp:
2724 (JSObject::listFromJArray):
2725 * bindings/runtime.h:
2726 (KJS::Bindings::Instance::begin):
2727 (KJS::Bindings::Instance::end):
2728 * bindings/runtime_object.cpp:
2729 (RuntimeObjectImp::get):
2730 (RuntimeObjectImp::put):
2731 (RuntimeObjectImp::canPut):
2732 (RuntimeObjectImp::hasProperty):
2733 (RuntimeObjectImp::defaultValue):
2735 2004-01-15 Vicki Murley <vicki@apple.com>
2739 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
2741 2004-01-14 Richard Williamson <rjw@apple.com>
2743 Fixed 3529466. With recent changes to Java plugin we must no
2744 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
2748 * bindings/jni/jni_instance.cpp:
2749 (JObjectWrapper::JObjectWrapper):
2753 2004-01-14 Richard Williamson <rjw@apple.com>
2757 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.
2761 * bindings/jni_jsobject.cpp:
2763 (removeJavaReference):
2764 (RootObject::removeAllJavaReferencesForRoot):
2767 2004-01-13 Richard Williamson <rjw@apple.com>
2771 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.
2775 * bindings/jni_jsobject.h:
2776 (KJS::Bindings::RootObject::~RootObject):
2782 2004-01-06 Richard Williamson <rjw@apple.com>
2784 Fixed 3521814. Finalize messages weren't being dispatched!
2788 * bindings/jni_jsobject.cpp:
2791 2004-01-05 Richard Williamson <rjw@apple.com>
2793 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
2794 described by 3515579.
2796 Also cleanup up logging of Java exceptions.
2800 * bindings/jni/jni_class.cpp:
2801 (JavaClass::classForInstance):
2802 * bindings/jni/jni_instance.cpp:
2803 (JavaInstance::JavaInstance):
2804 (JavaInstance::getClass):
2805 (JavaInstance::invokeMethod):
2806 (JObjectWrapper::JObjectWrapper):
2807 (JObjectWrapper::~JObjectWrapper):
2808 * bindings/jni/jni_instance.h:
2809 (KJS::Bindings::JavaInstance::operator=):
2810 * bindings/jni/jni_runtime.cpp:
2811 (JavaMethod::JavaMethod):
2812 (JavaMethod::methodID):
2813 * bindings/jni/jni_runtime.h:
2814 (KJS::Bindings::JavaMethod::JavaMethod):
2815 * bindings/jni/jni_utility.cpp:
2819 (KJS::Bindings::getMethodID):
2820 (KJS::Bindings::callJNIVoidMethodIDA):
2821 (KJS::Bindings::callJNIObjectMethodIDA):
2822 (KJS::Bindings::callJNIByteMethodIDA):
2823 (KJS::Bindings::callJNICharMethodIDA):
2824 (KJS::Bindings::callJNIShortMethodIDA):
2825 (KJS::Bindings::callJNIIntMethodIDA):
2826 (KJS::Bindings::callJNILongMethodIDA):
2827 (KJS::Bindings::callJNIFloatMethodIDA):
2828 (KJS::Bindings::callJNIDoubleMethodIDA):
2829 (KJS::Bindings::callJNIBooleanMethodIDA):
2830 (KJS::Bindings::getCharactersFromJStringInEnv):
2831 (KJS::Bindings::getUCharactersFromJStringInEnv):
2832 (KJS::Bindings::getJNIField):
2833 * bindings/jni/jni_utility.h:
2835 l2003-12-23 John Sullivan <sullivan@apple.com>
2837 * JavaScriptCore.pbproj/project.pbxproj:
2838 Xcode version wars, harmless
2840 2003-12-23 Darin Adler <darin@apple.com>
2842 Reviewed by John (concept, not code, which is just the old code coming back).
2844 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
2846 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
2847 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
2849 2003-12-19 Richard Williamson <rjw@apple.com>
2851 Fixed 3515597. When an error occurs we need
2852 to make sure result values are zeroed.
2854 Cleaned up logs by adding a newline.
2858 * bindings/jni/jni_utility.cpp:
2859 (KJS::Bindings::getJavaVM):
2860 (KJS::Bindings::getJNIEnv):
2863 (KJS::Bindings::getJNIField):
2864 * bindings/jni_jsobject.cpp:
2865 (JSObject::convertValueToJObject):
2869 2003-12-17 Richard Williamson <rjw@apple.com>
2871 Ensure that all the symbols we export are in the KJS
2872 namespace (3512245).
2874 Also renamed JavaString.characters() to JavaString.UTF8String()
2875 for enhanced clarity.
2877 Added some sanity checking to constructor of JObjectWrapper.
2882 * bindings/jni/jni_class.cpp:
2883 * bindings/jni/jni_class.h:
2884 * bindings/jni/jni_instance.cpp:
2885 (JavaInstance::invokeMethod):
2886 (JObjectWrapper::JObjectWrapper):
2887 * bindings/jni/jni_instance.h:
2888 * bindings/jni/jni_runtime.cpp:
2889 (JavaParameter::JavaParameter):
2890 (JavaField::JavaField):
2891 (JavaMethod::JavaMethod):
2892 (JavaMethod::signature):
2893 * bindings/jni/jni_runtime.h:
2894 (KJS::Bindings::JavaString::ascii):
2895 (KJS::Bindings::JavaString::UTF8String):
2896 (KJS::Bindings::JavaString::JavaString):
2897 (KJS::Bindings::JavaString::_commonInit):
2898 (KJS::Bindings::JavaString::uchars):
2899 (KJS::Bindings::JavaString::length):
2900 (KJS::Bindings::JavaString::ustring):
2901 (KJS::Bindings::JavaParameter::type):
2902 (KJS::Bindings::JavaField::name):
2903 (KJS::Bindings::JavaField::type):
2904 (KJS::Bindings::JavaMethod::name):
2905 (KJS::Bindings::JavaMethod::returnType):
2906 * bindings/jni/jni_utility.cpp:
2907 (KJS::Bindings::getJavaVM):
2908 (KJS::Bindings::getJNIEnv):
2909 (KJS::Bindings::callJNIVoidMethod):
2910 (KJS::Bindings::callJNIObjectMethod):
2911 (KJS::Bindings::callJNIBooleanMethod):
2912 (KJS::Bindings::callJNIByteMethod):
2913 (KJS::Bindings::callJNICharMethod):
2914 (KJS::Bindings::callJNIShortMethod):
2915 (KJS::Bindings::callJNIIntMethod):
2916 (KJS::Bindings::callJNILongMethod):
2917 (KJS::Bindings::callJNIFloatMethod):
2918 (KJS::Bindings::callJNIDoubleMethod):
2919 (KJS::Bindings::callJNIVoidMethodA):
2920 (KJS::Bindings::callJNIObjectMethodA):
2921 (KJS::Bindings::callJNIByteMethodA):
2922 (KJS::Bindings::callJNICharMethodA):
2923 (KJS::Bindings::callJNIShortMethodA):
2924 (KJS::Bindings::callJNIIntMethodA):
2925 (KJS::Bindings::callJNILongMethodA):
2926 (KJS::Bindings::callJNIFloatMethodA):
2927 (KJS::Bindings::callJNIDoubleMethodA):
2928 (KJS::Bindings::callJNIBooleanMethodA):
2929 (KJS::Bindings::getCharactersFromJString):
2930 (KJS::Bindings::releaseCharactersForJString):
2931 (KJS::Bindings::getCharactersFromJStringInEnv):
2932 (KJS::Bindings::releaseCharactersForJStringInEnv):
2933 (KJS::Bindings::getUCharactersFromJStringInEnv):
2934 (KJS::Bindings::releaseUCharactersForJStringInEnv):
2935 (KJS::Bindings::JNITypeFromClassName):
2936 (KJS::Bindings::signatureFromPrimitiveType):
2937 (KJS::Bindings::JNITypeFromPrimitiveType):
2938 (KJS::Bindings::getJNIField):
2939 (KJS::Bindings::convertValueToJValue):
2940 * bindings/jni/jni_utility.h:
2941 * bindings/jni_jsobject.cpp:
2942 (KJS::Bindings::JSObject::invoke):
2943 (KJS::Bindings::JSObject::JSObject):
2944 (KJS::Bindings::JSObject::call):
2945 (KJS::Bindings::JSObject::eval):
2946 (KJS::Bindings::JSObject::getMember):
2947 (KJS::Bindings::JSObject::setMember):
2948 (KJS::Bindings::JSObject::removeMember):
2949 (KJS::Bindings::JSObject::getSlot):
2950 (KJS::Bindings::JSObject::setSlot):
2951 (KJS::Bindings::JSObject::toString):
2952 (KJS::Bindings::JSObject::finalize):
2953 (KJS::Bindings::JSObject::createNative):
2954 (KJS::Bindings::JSObject::convertValueToJObject):
2955 (KJS::Bindings::JSObject::convertJObjectToValue):
2956 (KJS::Bindings::JSObject::listFromJArray):
2957 * bindings/jni_jsobject.h:
2958 * bindings/runtime.cpp:
2959 * bindings/runtime.h:
2960 * bindings/runtime_method.cpp:
2961 * bindings/runtime_method.h:
2965 2003-12-16 Richard Williamson <rjw@apple.com>
2967 Ack! More assertions. Lock ALL entry points into the interpreter!
2972 * bindings/jni_jsobject.cpp:
2973 (Bindings::JSObject::call):
2974 (Bindings::JSObject::eval):
2975 (Bindings::JSObject::getMember):
2976 (Bindings::JSObject::setMember):
2977 (Bindings::JSObject::removeMember):
2978 (Bindings::JSObject::getSlot):
2979 (Bindings::JSObject::setSlot):
2980 (Bindings::JSObject::convertJObjectToValue):
2982 2003-12-15 Richard Williamson <rjw@apple.com>
2984 Fixed a couple of snafus and removed some logging.
2988 * bindings/jni_jsobject.cpp:
2989 (Bindings::performJavaScriptAccess):
2990 (Bindings::completedJavaScriptAccess):
2991 (Bindings::dispatchToJavaScriptThread):
2992 Removed some annoying JS_LOG clutter.
2994 (Bindings::RootObject::removeAllJavaReferencesForRoot):
2995 Fixed allocation of key buffer that was called after it was needed.
2997 (Bindings::JSObject::invoke):
2998 (Bindings::JSObject::JSObject):
2999 (Bindings::JSObject::getMember):
3000 (Bindings::JSObject::getSlot):
3001 Added additional interpreter locks around getMember and getSlot.
3002 These functions may cause allocation of JS impls.
3004 2003-12-15 Richard Williamson <rjw@apple.com>
3006 args weren't passed to 'call' invocation. d'oh.
3007 lock interpreter when we create instances of JS impls.
3011 * bindings/jni_jsobject.cpp:
3012 (Bindings::JSObject::call):
3013 (Bindings::JSObject::eval):
3014 (Bindings::JSObject::getMember):
3015 (Bindings::JSObject::setMember):
3016 (Bindings::JSObject::getSlot):
3017 (Bindings::JSObject::convertValueToJObject):
3018 (Bindings::JSObject::convertJObjectToValue):
3019 (Bindings::JSObject::listFromJArray):
3020 * bindings/jni_jsobject.h:
3022 2003-12-15 Richard Williamson <rjw@apple.com>
3024 Last piece of LiveConnect! This checkin adds implementation
3025 of the Java to JavaScript object conversion functions.
3029 * bindings/jni/jni_instance.cpp:
3030 (JavaInstance::invokeMethod):
3031 * bindings/jni/jni_utility.cpp:
3032 * bindings/jni/jni_utility.h:
3033 * bindings/jni_jsobject.cpp:
3034 (Bindings::JSObject::invoke):
3035 (Bindings::JSObject::call):
3036 (Bindings::JSObject::eval):
3037 (Bindings::JSObject::getMember):
3038 (Bindings::JSObject::setMember):
3039 (Bindings::JSObject::getSlot):
3040 (Bindings::JSObject::setSlot):
3041 (Bindings::JSObject::createNative):
3042 (Bindings::JSObject::convertValueToJObject):
3043 (Bindings::JSObject::convertJObjectToValue):
3044 (Bindings::JSObject::listFromJArray):
3045 * bindings/jni_jsobject.h:
3047 * bindings/runtime_method.cpp:
3048 (RuntimeMethodImp::get):
3049 (RuntimeMethodImp::codeType):
3050 (RuntimeMethodImp::execute):
3052 2003-12-12 Richard Williamson <rjw@apple.com>
3054 Added implementation of stubs in JSObject. All that
3055 remains is a couple of simple conversion functions stubs and
3056 we're done with LiveConnect. Also, changed string passing to
3057 JS to use uchars instead of chars.
3061 * bindings/jni/jni_runtime.h:
3062 (Bindings::JavaString::JavaString):
3063 (Bindings::JavaString::_commonInit):
3064 (Bindings::JavaString::_commonCopy):
3065 (Bindings::JavaString::_commonDelete):
3066 (Bindings::JavaString::~JavaString):
3067 (Bindings::JavaString::operator=):
3068 (Bindings::JavaString::uchars):
3069 (Bindings::JavaString::length):
3070 (Bindings::JavaString::ustring):
3071 * bindings/jni/jni_utility.cpp:
3072 (getUCharactersFromJStringInEnv):
3073 (releaseUCharactersForJStringInEnv):
3074 (convertValueToJObject):
3075 (convertJObjectToValue):
3076 * bindings/jni/jni_utility.h:
3077 * bindings/jni_jsobject.cpp:
3078 (Bindings::JSObject::invoke):
3079 (Bindings::JSObject::call):
3080 (Bindings::JSObject::eval):
3081 (Bindings::JSObject::getMember):
3082 (Bindings::JSObject::setMember):
3083 (Bindings::JSObject::removeMember):
3084 (Bindings::JSObject::getSlot):
3085 (Bindings::JSObject::setSlot):
3086 * bindings/jni_jsobject.h:
3088 2003-12-12 Richard Williamson <rjw@apple.com>
3090 Ensure that all calls from Java into JavaScript are
3091 performed on a designated thread (the main thread).
3095 * bindings/jni_jsobject.cpp:
3096 (isJavaScriptThread):
3098 (Bindings::performJavaScriptAccess):
3099 (Bindings::completedJavaScriptAccess):
3100 (Bindings::initializeJavaScriptAccessLock):
3101 (Bindings::lockJavaScriptAccess):
3102 (Bindings::unlockJavaScriptAccess):
3103 (Bindings::dispatchToJavaScriptThread):
3104 (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
3105 (Bindings::RootObject::removeAllJavaReferencesForRoot):
3106 (Bindings::JSObject::invoke):
3107 (Bindings::JSObject::JSObject):
3108 (Bindings::JSObject::call):
3109 (Bindings::JSObject::eval):
3110 (Bindings::JSObject::getMember):
3111 (Bindings::JSObject::setMember):
3112 (Bindings::JSObject::removeMember):
3113 (Bindings::JSObject::getSlot):
3114 (Bindings::JSObject::setSlot):
3115 (Bindings::JSObject::toString):
3116 (Bindings::JSObject::finalize):
3117 (Bindings::JSObject::getWindow):
3118 * bindings/jni_jsobject.h:
3119 (Bindings::RootObject::~RootObject):
3120 (Bindings::RootObject::findRootObjectForNativeHandleFunction):
3121 (Bindings::RootObject::runLoop):
3122 (Bindings::RootObject::performJavaScriptSource):
3125 2003-12-11 Richard Williamson <rjw@apple.com>
3127 Added support for calling a JavaScript function from
3128 Java. Right now this only works for void func(void)
3129 functions, but the conversion of args and return values
3132 Cleaned up and verified reference counting scheme, and
3133 dereferencing of vended JavaScript objects when applet is
3134 destroyed (actually when part is destroyed).
3136 Removed link hack for testkjs now that the Java folks think
3137 they have a solution for the 1.4.2 JavaVM link problem. Although
3138 Greg B. thinks his solution may cause problems for the 1.3.1
3139 version of the VM!?!
3144 * bindings/jni/jni_runtime.h:
3145 (Bindings::JavaString::JavaString):
3146 * bindings/jni/jni_utility.cpp:
3147 (convertValueToJValue):
3148 (convertValueToJObject):
3150 * bindings/jni/jni_utility.h:
3151 * bindings/jni_jsobject.cpp:
3152 (KJS_setFindRootObjectForNativeHandleFunction):
3153 (KJS_findRootObjectForNativeHandleFunction):
3154 (getReferencesByRootDictionary):
3155 (getReferencesDictionary):
3156 (findReferenceDictionary):
3159 (removeJavaReference):
3160 * bindings/jni_jsobject.h:
3161 (Bindings::RootObject::RootObject):
3162 (Bindings::RootObject::~RootObject):
3163 (Bindings::RootObject::setRootObjectImp):
3164 (Bindings::RootObject::rootObjectImp):
3165 (Bindings::RootObject::setInterpreter):
3166 (Bindings::RootObject::interpreter):
3170 2003-12-10 Darin Adler <darin@apple.com>
3174 - fixed regression in JavaScript tests reported by the KDE guys
3175 - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
3177 * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
3179 (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
3180 tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
3181 and binary compatibility than default parameter values.
3182 (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
3184 * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
3185 "tolerate empty string" parameter.
3187 2003-12-10 Richard Williamson <rjw@apple.com>
3189 Added code to manage reference counting of JavaScript
3190 objects passed to Java. Also added implementation of
3191 KJS_JSCreateNativeJSObject. This is the function that
3192 provides the root object to Java (KJS::Window).
3196 * JavaScriptCore.pbproj/project.pbxproj:
3197 * bindings/jni_jsobject.cpp:
3198 (KJS_setFindObjectForNativeHandleFunction):
3199 (KJS_findObjectForNativeHandleFunction):
3200 (getReferencesByOwnerDictionary):
3201 (getReferencesDictionary):
3202 (findReferenceDictionary):
3204 (removeJavaReference):
3205 (removeAllJavaReferencesForOwner):
3206 * bindings/jni_jsobject.h:
3208 2003-12-09 Richard Williamson <rjw@apple.com>
3210 LiveConnect stubs that correspond to the native methods
3211 on JSObject. These will be called from the new Java plugin
3212 when an instance of JSObject is instantiated and messaged.
3213 When these are implemented the Java will be able to originate
3214 calls into JavaScript.
3216 Also a temporary work-around added to Makefile.am to solve
3217 a link problem. The 1.4.2 JavaVM accidentally links against
3218 libobjc. This call a failure linking testkjs. Mike Hay is
3219 working with someone to fix the problem (3505587).
3223 * JavaScriptCore.pbproj/project.pbxproj:
3225 * bindings/jni_jsobject.cpp: Added.
3226 (KJS_JSCreateNativeJSObject):
3227 (KJS_JSObject_JSFinalize):
3228 (KJS_JSObject_JSObjectCall):
3229 (KJS_JSObject_JSObjectEval):
3230 (KJS_JSObject_JSObjectGetMember):
3231 (KJS_JSObject_JSObjectSetMember):
3232 (KJS_JSObject_JSObjectRemoveMember):
3233 (KJS_JSObject_JSObjectGetSlot):
3234 (KJS_JSObject_JSObjectSetSlot):
3235 (KJS_JSObject_JSObjectToString):
3236 * bindings/jni_jsobject.h: Added.
3238 2003-12-09 Maciej Stachowiak <mjs@apple.com>
3242 <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
3244 * kjs/collector.cpp:
3245 (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
3246 (KJS::Collector::collect): likewise
3248 2003-12-08 Richard Williamson <rjw@apple.com>
3250 LiveConnect: The last piece of the JavaScript side of the
3251 LiveConnect implementation. This change adds support for
3252 setting/getting values from Java arrays in JavaScript.
3256 * bindings/jni/jni_instance.h:
3257 * bindings/jni/jni_runtime.cpp:
3258 (JavaField::JavaField):
3259 (convertJObjectToArray):
3260 (JavaArray::JavaArray):
3261 (JavaArray::~JavaArray):
3262 (JavaArray::setValueAt):
3263 (JavaArray::valueAt):
3264 (JavaArray::getLength):
3265 * bindings/jni/jni_runtime.h:
3266 (Bindings::JavaArray::operator=):
3267 (Bindings::JavaArray::javaArray):
3268 * bindings/jni/jni_utility.cpp:
3269 (JNITypeFromPrimitiveType):
3270 (convertValueToJValue):
3271 * bindings/jni/jni_utility.h:
3272 * bindings/runtime.h:
3273 * bindings/runtime_array.cpp:
3274 (RuntimeArrayImp::RuntimeArrayImp):
3275 (RuntimeArrayImp::~RuntimeArrayImp):
3276 (RuntimeArrayImp::get):
3277 (RuntimeArrayImp::put):
3278 (RuntimeArrayImp::hasProperty):
3279 * bindings/runtime_array.h:
3280 (KJS::RuntimeArrayImp::getLength):
3281 (KJS::RuntimeArrayImp::getConcreteArray):
3282 * bindings/runtime_object.cpp:
3283 (RuntimeObjectImp::get):
3284 (RuntimeObjectImp::canPut):
3285 (RuntimeObjectImp::hasProperty):
3287 2003-12-05 Richard Williamson <rjw@apple.com>
3289 LiveConnect: Part 1 of supporting JS bindings to
3290 native language arrays.
3294 * JavaScriptCore.pbproj/project.pbxproj:
3295 * bindings/jni/jni_runtime.cpp:
3296 (JavaField::JavaField):
3297 (convertJObjectToArray):
3298 (JavaField::valueFromInstance):
3299 (JavaField::setValueToInstance):
3300 * bindings/jni/jni_runtime.h:
3301 * bindings/runtime.cpp:
3302 (Instance::setValueOfField):
3303 * bindings/runtime.h:
3304 (Bindings::Array::~Array):
3306 2003-12-04 Richard Williamson <rjw@apple.com>
3308 LiveConnect: Moved defaultValue into concrete implementation because
3309 more intelligent conversion can be perform with knowledge
3310 of the class of the original instance.
3314 * bindings/jni/jni_class.cpp:
3315 (JavaClass::isNumberClass):
3316 (JavaClass::isBooleanClass):
3317 (JavaClass::isStringClass):
3318 * bindings/jni/jni_class.h:
3319 * bindings/jni/jni_instance.cpp:
3320 (JavaInstance::defaultValue):
3321 (JavaInstance::valueOf):
3322 * bindings/jni/jni_instance.h:
3323 (Bindings::JavaInstance::javaInstance):
3324 * bindings/runtime.h:
3325 * bindings/runtime_object.cpp:
3326 (RuntimeObjectImp::defaultValue):
3328 2003-12-04 Richard Williamson <rjw@apple.com>
3330 LiveConnect: Added support for setting the value of Java
3335 * bindings/jni/jni_instance.cpp:
3336 (JavaInstance::invokeMethod):
3337 * bindings/jni/jni_runtime.cpp:
3338 (JavaParameter::JavaParameter):
3339 (JavaField::JavaField):
3340 (JavaField::valueFromInstance):
3341 (JavaField::setValueToInstance):
3342 (JavaMethod::JavaMethod):
3343 * bindings/jni/jni_runtime.h:
3344 (Bindings::JavaField::getJNIType):
3345 * bindings/jni/jni_utility.cpp:
3346 (JNITypeFromClassName):
3347 (convertValueToJValue):
3348 * bindings/jni/jni_utility.h:
3349 * bindings/runtime.cpp:
3350 (Instance::setValueOfField):
3351 * bindings/runtime.h:
3352 * bindings/runtime_object.cpp:
3353 (RuntimeObjectImp::get):
3354 (RuntimeObjectImp::put):
3355 (RuntimeObjectImp::defaultValue):
3357 2003-12-04 Richard Williamson <rjw@apple.com>
3359 Added support for string conversions.
3360 Changed various JavaString member variables to be inline.
3361 Implemented defaultValue for context relevant type coercion.
3365 * bindings/jni/jni_class.cpp:
3366 (JavaClass::JavaClass):
3367 (JavaClass::setClassName):
3368 (JavaClass::classForInstance):
3369 * bindings/jni/jni_class.h:
3370 * bindings/jni/jni_instance.cpp:
3371 (JavaInstance::stringValue):
3372 (JavaInstance::numberValue):
3373 (JavaInstance::booleanValue):
3374 (JavaInstance::invokeMethod):
3375 * bindings/jni/jni_instance.h:
3376 * bindings/jni/jni_runtime.cpp:
3377 (JavaParameter::JavaParameter):
3378 (JavaField::JavaField):
3379 (JavaMethod::JavaMethod):
3381 (JavaMethod::signature):
3382 * bindings/jni/jni_runtime.h:
3383 (Bindings::JavaString::JavaString):
3384 (Bindings::JavaString::~JavaString):
3385 (Bindings::JavaString::operator=):
3386 (Bindings::JavaString::characters):
3387 (Bindings::JavaParameter::JavaParameter):
3388 (Bindings::JavaParameter::~JavaParameter):
3389 (Bindings::JavaParameter::operator=):
3390 (Bindings::JavaParameter::type):
3391 (Bindings::JavaField::JavaField):
3392 (Bindings::JavaField::~JavaField):
3393 (Bindings::JavaField::operator=):
3394 (Bindings::JavaField::name):
3395 (Bindings::JavaField::type):
3396 (Bindings::JavaMethod::JavaMethod):
3397 (Bindings::JavaMethod::_commonDelete):
3398 (Bindings::JavaMethod::name):
3399 (Bindings::JavaMethod::returnType):
3400 * bindings/jni/jni_utility.cpp:
3401 (convertValueToJValue):
3402 * bindings/runtime.h:
3403 (Bindings::Instance::valueOf):
3404 * bindings/runtime_method.cpp:
3405 (RuntimeMethodImp::call):
3406 * bindings/runtime_object.cpp:
3407 (RuntimeObjectImp::RuntimeObjectImp):
3408 (RuntimeObjectImp::get):
3409 (RuntimeObjectImp::defaultValue):
3410 * bindings/runtime_object.h:
3411 (KJS::RuntimeObjectImp::classInfo):
3415 2003-12-03 Richard Williamson <rjw@apple.com>
3417 LiveConnect: Added support for parameter passing to Java and conversion
3422 * bindings/jni/jni_instance.cpp:
3423 (JavaInstance::invokeMethod):
3424 * bindings/jni/jni_instance.h:
3425 * bindings/jni/jni_runtime.cpp:
3426 (JavaParameter::JavaParameter):
3427 (JavaMethod::JavaMethod):
3428 (JavaMethod::signature):
3429 * bindings/jni/jni_runtime.h:
3430 (Bindings::JavaParameter::JavaParameter):
3431 (Bindings::JavaParameter::operator=):
3432 (Bindings::JavaParameter::getJNIType):
3433 * bindings/jni/jni_utility.cpp:
3434 (callJNIBooleanMethodA):
3435 (convertValueToJValue):
3436 * bindings/jni/jni_utility.h:
3437 * bindings/runtime.h:
3438 * bindings/runtime_method.cpp:
3439 (RuntimeMethodImp::call):
3440 * bindings/runtime_object.cpp:
3441 (RuntimeObjectImp::get):
3443 2003-12-02 Richard Williamson <rjw@apple.com>
3445 Added support for calling simple methods in Java from JavaScript.
3446 (void return and no parameters). Yay, LiveConnect lives.
3448 Still need write argument and return value conversion code.
3452 * JavaScriptCore.pbproj/project.pbxproj:
3453 * bindings/jni/jni_instance.cpp:
3454 (JavaInstance::getClass):
3455 (JavaInstance::invokeMethod):
3456 * bindings/jni/jni_instance.h:
3457 * bindings/jni/jni_runtime.cpp:
3458 (JavaMethod::JavaMethod):
3459 (JavaMethod::signature):
3460 (JavaMethod::JNIReturnType):
3461 * bindings/jni/jni_runtime.h:
3462 (Bindings::JavaMethod::_commonDelete):
3463 (Bindings::JavaMethod::_commonCopy):
3464 (Bindings::JavaMethod::name):
3465 * bindings/jni/jni_utility.cpp:
3466 (signatureFromPrimitiveType):
3467 * bindings/jni/jni_utility.h:
3468 * bindings/runtime.h:
3469 * bindings/runtime_method.cpp: Added.
3470 (RuntimeMethodImp::RuntimeMethodImp):
3471 (RuntimeMethodImp::~RuntimeMethodImp):
3472 (RuntimeMethodImp::get):
3473 (RuntimeMethodImp::implementsCall):
3474 (RuntimeMethodImp::call):
3475 (RuntimeMethodImp::codeType):
3476 (RuntimeMethodImp::execute):
3477 * bindings/runtime_method.h: Added.
3478 * bindings/runtime_object.cpp:
3479 (RuntimeObjectImp::RuntimeObjectImp):
3480 (RuntimeObjectImp::get):
3481 * bindings/runtime_object.h:
3483 (FunctionImp::FunctionImp):
3484 * kjs/interpreter.h:
3486 2003-12-01 Darin Adler <darin@apple.com>
3490 - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
3492 * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
3493 This indirectly caused the string.replace bug.
3495 2003-12-02 Maciej Stachowiak <mjs@apple.com>
3497 Merged patches from Harri Porten and David Faure to fix:
3499 <rdar://problem/3497643>: reproducible crash printing self-referential array
3501 * kjs/array_object.cpp:
3502 (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
3504 (FunctionCallNode::evaluate): Move function call depth check from here...
3506 (KJS::Object::call): ...to here.
3507 * kjs/object.h: Un-inline Object::call now that it does more.
3509 2003-12-01 Richard Williamson <rjw@apple.com>
3511 Fixed mistake in method signatures used to get boolean and integer fields.
3515 * bindings/jni/jni_runtime.cpp:
3516 (JavaField::valueFromInstance):
3518 2003-12-01 Richard Williamson <rjw@apple.com>
3520 Fixed parameter passing to applet. Child elements are NOT valid in setStyle(). So we now create the widget before needed with createWidgetIfNecessary. This either happens when doing the first layout, or when JavaScript first references the applet element.
3522 Fixed early delete of the the main applet instance. When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance. This caused the applet instance cached on the applet element to be invalid. The applet instance is the only Java object not to be cleaned up by the JS collector.
3524 Added support for getting at Java object fields.
3528 * JavaScriptCore.pbproj/project.pbxproj:
3530 * bindings/jni/jni_instance.cpp:
3531 (JObjectWrapper::JObjectWrapper):
3532 * bindings/jni/jni_instance.h:
3533 (Bindings::JObjectWrapper::~JObjectWrapper):
3534 * bindings/jni/jni_runtime.cpp:
3535 (JavaField::valueFromInstance):
3536 * bindings/runtime_object.cpp:
3537 (RuntimeObjectImp::~RuntimeObjectImp):
3538 (RuntimeObjectImp::RuntimeObjectImp):
3539 (RuntimeObjectImp::get):
3540 (RuntimeObjectImp::deleteProperty):
3541 * bindings/runtime_object.h:
3545 2003-11-21 Maciej Stachowiak <mjs@apple.com>
3547 Patch from Harri Porten, reviewed by me.
3549 - fixed 3491712 - String slice with negative arguments does not offset from end of string
3551 * kjs/string_object.cpp:
3552 (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
3553 adding length and clamping to [0,length-1].
3555 2003-11-21 Maciej Stachowiak <mjs@apple.com>
3557 Patch from Harri Porten, reviewed by me.
3559 - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
3561 * kjs/function_object.cpp:
3562 (FunctionProtoFuncImp::call): Nest parentheses properly.
3564 2003-11-20 Richard Williamson <rjw@apple.com>
3566 More LiveConnect stuff. Primitive Java fields are now
3567 accessible from JavaScript! Yay!
3571 * bindings/jni/jni_class.cpp:
3572 (JavaClass::methodNamed):
3573 (JavaClass::fieldNamed):
3574 * bindings/jni/jni_class.h: