Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstanc...
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2005-05-03  Richard Williamson   <rjw@apple.com>
2
3         Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
4
5         Correctly handle accessing nil objects from a Java object array.
6
7         Reviewed by John.
8
9         * bindings/jni/jni_runtime.cpp:
10         (JavaArray::valueAt):
11
12 2005-05-01  Darin Adler  <darin@apple.com>
13
14         - move to Xcode native targets and stop checking in generated files
15
16         * JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
17         files, so we don't have to check them in any more.
18         * Info.plist: Added. Native targets use a separate file for this.
19
20         * Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
21         framework, since we haven't been embedding it for some time.
22
23         * kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
24         easily to the list of files to be compiled.
25
26         * kjs/.cvsignore: Removed.
27         * kjs/Makefile.am: Removed.
28         * kjs/array_object.lut.h: Removed.
29         * kjs/date_object.lut.h: Removed.
30         * kjs/grammar.cpp: Removed.
31         * kjs/grammar.cpp.h: Removed.
32         * kjs/grammar.h: Removed.
33         * kjs/lexer.lut.h: Removed.
34         * kjs/math_object.lut.h: Removed.
35         * kjs/number_object.lut.h: Removed.
36         * kjs/string_object.lut.h: Removed.
37         * pcre/.cvsignore: Removed.
38         * pcre/Makefile.am: Removed.
39         * pcre/chartables.c: Removed.
40
41 2005-04-28  Darin Adler  <darin@apple.com>
42
43         Reviewed by Dave Harrison.
44
45         - fixed problems preventing us from compiling with gcc 4.0
46
47         * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
48         WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
49
50         * bindings/jni/jni_jsobject.cpp:
51         (JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
52         (JSObject::setSlot): Ditto.
53         * bindings/jni/jni_utility.cpp:
54         (KJS::Bindings::getJavaVM): Ditto.
55         (KJS::Bindings::getJNIEnv): Ditto.
56         * bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
57         letter "S" capitalized.
58         * kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
59         avoid incorrect gcc 4.0 warning.
60         * kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
61         the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
62         Prevents a crash on garbage collect when compiled with gcc 4.0.
63         * kjs/nodes.cpp:
64         (WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
65         (ForNode::execute): Ditto.
66         (SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
67         (LabelNode::execute): Ditto.
68         * kjs/string_object.cpp: (replace): Ditto.
69
70 2005-04-26  Richard Williamson   <rjw@apple.com>
71
72         Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
73         
74         We were incompatible with Mozilla's implementation of the scripting APIs in
75         two ways:
76
77         Their NPN_SetException has the following signature:
78
79             void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
80
81         ours has:
82
83             void NPN_SetException (NPObject * npobj, const NPString *message);
84
85         Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
86         We do not.
87
88         I changed both behaviors to match Mozilla.
89
90         Reviewed by Chris.
91
92         * bindings/NP_jsobject.cpp:
93         (_NPN_SetException):
94         * bindings/npruntime.cpp:
95         (_NPN_UTF8FromIdentifier):
96         (_NPN_IntFromIdentifier):
97         (_NPN_SetExceptionWithUTF8):
98         * bindings/npruntime.h:
99         * bindings/npruntime_impl.h:
100
101 2005-04-26  Maciej Stachowiak  <mjs@apple.com>
102
103         Reviewed by Chris.
104
105         <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
106         
107         * kjs/string_object.cpp:
108         (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
109
110 2005-04-22  Darin Adler  <darin@apple.com>
111
112         Reviewed by Maciej.
113
114         * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
115
116 2005-04-22  Darin Adler  <darin@apple.com>
117
118         Reviewed by John.
119
120         - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
121
122         * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
123         Not sure why we missed this one earlier.
124
125         * kjs/grammar.cpp: Regenerated.
126
127 === JavaScriptCore-412.1 ===
128
129 2005-04-20  Darin Adler  <darin@apple.com>
130
131         Reviewed by Maciej.
132
133         - speedups, total 12% on JavaScript iBench
134
135         I ran the benchmark under Shark and followed its advice a lot, mainly.
136
137         * kjs/collector.cpp:
138         (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
139         Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
140         have to bump it each time we call allocate. Put numLiveObjects into a local variable to
141         cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
142         than a pointer so we don't need a special case for NULL. Allow freeList to point to some
143         bogus item when the entire block is full rather than going out of our way to make it
144         point to NULL.
145         (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
146         the loop to avoid re-loading them over and over again.
147         (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
148         variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
149         into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
150         rather than numAllocationsSinceLastCollect.
151         (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
152         the loop to avoid re-loading them over and over again.
153         (KJS::Collector::rootObjectClasses): Ditto.
154
155         * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
156         directly, avoiding the conversion from Number to Value.
157
158         * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
159         the thing is an object and we don't want to do all the extra work; just cast directly.
160
161         * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
162         a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
163
164         * kjs/lookup.cpp: (keysMatch): Marked this inline.
165
166         * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
167         (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
168         into a Value.
169         (NumberNode::evaluate): Ditto.
170         (StringNode::evaluate): Ditto.
171         (ArrayNode::evaluate): Ditto.
172         (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
173         Also just use a pointer for func, rather than an Object.
174         (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
175         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
176         integer and back.
177         (DeleteNode::evaluate): Make a Value directly.
178         (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
179         (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
180         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
181         integer and back.
182         (UnaryPlusNode::evaluate): Make a Value directly.
183         (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
184         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
185         integer and back.
186         (BitwiseNotNode::evaluate): Make a Value directly.
187         (LogicalNotNode::evaluate): Ditto.
188         (ShiftNode::evaluate): Don't convert to a double before making a Value.
189         (RelationalNode::evaluate): Make a Value directly.
190         (EqualNode::evaluate): Ditto.
191         (BitOperNode::evaluate): Ditto.
192         (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
193         boolean in, often avoiding a conversion from floating point to integer and back.
194         (VarDeclNode::evaluate): Make a Value directly.
195         (ForNode::execute): Remove unused local variable.
196
197         * kjs/operations.h:
198         (KJS::isNaN): Inlined.
199         (KJS::isInf): Ditto.
200         (KJS::isPosInf): Ditto.
201         (KJS::isNegInf): Ditto.
202
203         * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
204         (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
205         (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
206         (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
207         boolean in, often avoiding a conversion from floating point to integer and back.
208         (KJS::mult): Ditto.
209
210         * kjs/property_map.cpp:
211         (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
212         re-getting them inside the loop.
213         (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
214         look at the value pointer in the mark function.
215         (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
216         re-getting them inside the loop.
217         (KJS::PropertyMap::put): Ditto.
218         (KJS::PropertyMap::insert): Ditto.
219         (KJS::PropertyMap::remove): Ditto.
220         (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
221         re-getting them inside the loop. Don't bother checking key for 0, since we already have
222         to check value for 0. (Also had to change clear() to set value to 0.)
223         (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
224         loop to avoid re-getting them inside the loop.
225         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
226         (KJS::PropertyMap::save): Ditto.
227
228         - other changes
229
230         * kjs/protected_values.h: Remove unneeded class name qualifiers.
231
232         * kjs/reference.h:
233         (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
234         (KJS::Reference::Reference): Inlined.
235         * kjs/reference.cpp:
236         (KJS::Reference::getValue): Rewrite to not use getBase.
237         (KJS::Reference::putValue): Ditto.
238         (KJS::Reference::deleteValue): Dittol
239
240         * kjs/simple_number.h:
241         (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
242
243         * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
244         to double in various cases that involve integers.
245
246         * kjs/ustring.h:
247         (KJS::UString::attach): Inlined.
248         (KJS::UString::release): Inlined.
249         * kjs/ustring.cpp:
250         (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
251
252         * kjs/value.cpp:
253         (Value::Value): Added overloads for all the various specific types of values, so you don't have
254         to convert from, say, Number to Value, just to create one.
255         (Number::Number): Added an overload that takes a boolean to indicate the number is already
256         known to be an integer.
257
258         * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
259         a boolean to indicate if the number is known to be an integer (because it was a "simple number").
260         (KJS::ValueImp::marked): Inlined.
261         (KJS::ValueImp::dispatchType): Inlined.
262         (KJS::ValueImp::dispatchToPrimitive): Inlined.
263         (KJS::ValueImp::dispatchToBoolean): Inlined.
264         (KJS::ValueImp::dispatchToNumber): Inlined.
265         (KJS::ValueImp::dispatchToString): Inlined.
266         (KJS::ValueImp::dispatchToUInt32): Inlined.
267
268 2005-04-14  Maciej Stachowiak  <mjs@apple.com>
269
270         - make fast_malloc.h a private header, not project
271
272         * JavaScriptCore.pbproj/project.pbxproj:
273
274 2005-04-12  Maciej Stachowiak  <mjs@apple.com>
275
276         Reviewed by Richard.
277
278         <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
279
280         - use custom single-threaded malloc for all non-GC JavaScriptCore
281         allocations, for a 9.1% speedup on JavaScript iBench
282         
283         * JavaScriptCore.pbproj/project.pbxproj:
284         * kjs/collector.cpp:
285         (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
286         (KJS::Collector::collect): And dlfree to free it.
287         * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
288         * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
289         macro to give a class custom operator new/delete
290         * kjs/identifier.cpp:
291         (KJS::Identifier::add): Use dlmalloc/dlfree.
292         * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
293         * kjs/property_map.cpp:
294         (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
295         (KJS::PropertyMap::rehash): ditto
296         * kjs/scope_chain.h:
297         * kjs/ustring.cpp:
298         (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
299         buffer, to hide allocation details from webcore.
300         (KJS::UString::UString): use createCopying when appropriate.
301         (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
302         (KJS::UString::expandedSize): likewise
303         (KJS::UString::expandCapacity): likewise
304         (KJS::UString::expandPreCapacity): likewise
305         (KJS::UString::spliceSubstringsWithSeparators): likewise
306         (KJS::UString::append): likewise
307         (KJS::UString::operator=): likewise
308         (KJS::UString::detach): likewise
309         * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
310
311 2005-04-11  Maciej Stachowiak  <mjs@apple.com>
312
313         Reviewed by John.
314
315         <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
316
317         - Avoid using protected values hash for the two most common cases
318         - Bump up ListImp high water mark, new testing shows 508 ListImps are
319         created during JS iBench.
320
321         Net result is a 5.6% speedup on JavaScript iBench
322         
323         * kjs/collector.cpp:
324         (KJS::Collector::collect): mark protected lists as appropriate.
325         * kjs/context.h:
326         * kjs/list.cpp:
327         (KJS::ListImp::markValues): Moved implementation from List::markValues
328         (KJS::List::markProtectedLists): Implemented - scan pool and overflow
329         list.
330         (KJS::allocateListImp): link lists outside the pool into a separate
331         doubly linked list to be able to mark protected lists
332         (KJS::deallocateListImp): do the corresponding delinking
333         (KJS::List::derefValues): do nothing in conservative GC mode
334         (KJS::List::refValues): do nothing in conservative GC mode
335         (KJS::List::markValues): call ListImp version
336         (KJS::List::append):
337         * kjs/list.h:
338
339 === Safari-412 ===
340
341 === Safari-411 ===
342
343 === Safari-410 ===
344
345 === Safari-409 ===
346
347 === Safari-408 ===
348
349 === Safari-407 ===
350
351 2005-03-16  Jens Alfke  <jens@apple.com>
352
353         Reviewed by Kevin.
354
355         Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
356         JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
357         In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
358         Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
359
360         * kjs/function.cpp:
361         (KJS::GlobalFuncImp::call):
362
363 2005-03-15  Richard Williamson   <rjw@apple.com>
364
365         Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
366
367         Added JavaScript boolean to type that can be converted to
368         ObjC scalar parameters.
369
370         Reviewed by Ken Kocienda.
371
372         * bindings/objc/objc_utility.mm:
373         (KJS::Bindings::convertValueToObjcValue):
374
375 === Safari-406 ===
376
377 === Safari-405 ===
378
379 === Safari-403 ===
380
381 === Safari-402 ===
382
383 === Safari-401 ===
384
385 === Safari-400 ===
386
387 === Safari-188 ===
388
389 2005-02-21  Darin Adler  <darin@apple.com>
390
391         * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
392
393 2005-02-17  Richard Williamson   <rjw@apple.com>
394
395         Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
396
397         Added nil check.
398
399         Reviewed by John Sullivan.
400
401         * bindings/jni/jni_runtime.cpp:
402         (JavaField::valueFromInstance):
403
404 === Safari-187 ===
405
406 2005-02-11  Richard Williamson   <rjw@apple.com>
407
408         Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
409
410         Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
411         creates these wrappers.  The WebCore subclass of the interpreter now overrides
412         createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
413
414         Reviewed by Ken.
415
416         * bindings/c/c_utility.cpp:
417         (convertValueToNPVariant):
418         * bindings/jni/jni_instance.cpp:
419         (JavaInstance::invokeMethod):
420         * bindings/jni/jni_objc.mm:
421         (KJS::Bindings::dispatchJNICall):
422         * bindings/jni/jni_runtime.cpp:
423         (JavaField::valueFromInstance):
424         (JavaArray::valueAt):
425         * bindings/objc/WebScriptObject.mm:
426         (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
427         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
428         * bindings/objc/WebScriptObjectPrivate.h:
429         * bindings/objc/objc_utility.h:
430         * bindings/objc/objc_utility.mm:
431         (KJS::Bindings::convertObjcValueToValue):
432         (KJS::Bindings::createObjcInstanceForValue):
433         * bindings/runtime.cpp:
434         (Instance::createBindingForLanguageInstance):
435         (Instance::createRuntimeObject):
436         (Instance::createLanguageInstanceForValue):
437         * bindings/runtime.h:
438         * kjs/interpreter.cpp:
439         (Interpreter::createLanguageInstanceForValue):
440         * kjs/interpreter.h:
441
442 === Safari-186 ===
443
444 2005-02-10  Darin Adler  <darin@apple.com>
445
446         "Reviewed" by Richard (he told me the file was obsolete).
447
448         - got rid of an obsolete file
449
450         * bindings/npsap.h: Removed.
451
452 === Safari-185 ===
453
454 === Safari-183 ===
455
456 2005-02-03  Richard Williamson   <rjw@apple.com>
457
458         Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
459
460         Revert to old (and correct) behavior of returning runtime object
461         when passed as a parameter, rather than it's corresponding DOM
462         object.
463
464         Reviewed by Chris.
465
466         * bindings/objc/WebScriptObject.mm:
467         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
468
469 === Safari-182 ===
470
471 2005-01-28  Richard Williamson   <rjw@apple.com>
472
473         Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
474
475         Only use special 'back door' property to get the runtime object if thisObj isn't
476         already a runtime object.
477
478         <gratuitous> Cleaned up a couple of strcmp on ClassInfo name.  Used == on
479         ClassInfo pointer instead.
480
481         Reviewed by Chris.
482
483         * bindings/c/c_utility.cpp:
484         (convertValueToNPVariant):
485         * bindings/objc/WebScriptObject.mm:
486         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
487         * bindings/runtime_method.cpp:
488         (RuntimeMethodImp::call):
489
490 === Safari-181 ===
491
492 2005-01-26  Richard Williamson   <rjw@apple.com>
493
494         Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
495
496         I added a member variable to ObjectImp.  This changed it's size and consequently
497         hampered the optimizations built into the garbage collector.  Objects no longer
498         fit within the allocators cell size, and thus allocation fell back to a slower
499         allocator.
500
501         As a result of this fix I also dramatically cleaned up how runtime objects are
502         accessed.  The path mostly *removes* code.
503         
504         Reviewed by Chris.
505
506         * bindings/runtime_method.cpp:
507         (RuntimeMethodImp::call):
508         * bindings/runtime_object.cpp:
509         (RuntimeObjectImp::get):
510         (RuntimeObjectImp::put):
511         (RuntimeObjectImp::canPut):
512         (RuntimeObjectImp::hasProperty):
513         (RuntimeObjectImp::defaultValue):
514         * bindings/runtime_object.h:
515         * kjs/object.cpp:
516         (KJS::ObjectImp::ObjectImp):
517         * kjs/object.h:
518
519 2005-01-20  Darin Adler  <darin@apple.com>
520
521         Reviewed by me, changes by Han Ming Ong.
522
523         - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
524
525         * bindings/objc/WebScriptObjectPrivate.h: Make members public.
526         * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
527
528 2005-01-20  Richard Williamson   <rjw@apple.com>
529
530         Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
531
532         The comprehensive fix for this problem requires new API, as described in 3965326.  However,
533         given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
534         like and Undefined object if  invokeUndefinedMethodFromWebScript:withArguments: isn't
535         implemented on the bound object.
536
537         Reviewed by Chris.
538
539         * bindings/objc/objc_runtime.h:
540         * bindings/objc/objc_runtime.mm:
541         (ObjcFallbackObjectImp::type):
542         (ObjcFallbackObjectImp::implementsCall):
543         (ObjcFallbackObjectImp::toBoolean):
544         * bindings/testbindings.mm:
545         (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
546         (+[MyFirstInterface isKeyExcludedFromWebScript:]):
547
548 === Safari-180 ===
549
550 2005-01-19  Richard Williamson   <rjw@apple.com>
551
552         Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
553
554         Fixed the following problems with LiveConnect that are demonstrated by the application
555         described in 3853676.
556
557         1.  If a nil object is passed in an array from Java to JavaScript we will crash.
558         2.  We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
559         3.  We will sometimes fail to find the correct static method ID.
560
561         Reviewed by Maciej.
562
563         * bindings/jni/jni_jsobject.cpp:
564         (JSObject::convertJObjectToValue):
565         (JSObject::listFromJArray):
566         * bindings/jni/jni_runtime.cpp:
567         (JavaField::valueFromInstance):
568         (JavaField::setValueToInstance):
569         * bindings/jni/jni_utility.cpp:
570         (KJS::Bindings::getMethodID):
571         (KJS::Bindings::convertValueToJValue):
572         * bindings/runtime_array.h:
573
574 2005-01-18  Richard Williamson   <rjw@apple.com>
575
576         Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
577
578         Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
579         Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
580         Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
581         Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
582
583         We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
584         tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
585         Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
586
587         Reviewed by Chris.
588
589         * bindings/objc/objc_instance.h:
590         * bindings/objc/objc_instance.mm:
591         (ObjcInstance::supportsSetValueOfUndefinedField):
592         * bindings/runtime.h:
593         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
594         * bindings/runtime_object.cpp:
595         (RuntimeObjectImp::RuntimeObjectImp):
596         (RuntimeObjectImp::get):
597         (RuntimeObjectImp::put):
598         (RuntimeObjectImp::canPut):
599         (RuntimeObjectImp::hasProperty):
600         (RuntimeObjectImp::defaultValue):
601         * bindings/runtime_object.h:
602         (KJS::RuntimeObjectImp::fallbackObject):
603         * kjs/object.cpp:
604         (KJS::ObjectImp::ObjectImp):
605         * kjs/object.h:
606         (KJS::ObjectImp::forwardingScriptMessage):
607         (KJS::ObjectImp::setForwardingScriptMessage):
608
609 2005-01-18  Richard Williamson   <rjw@apple.com>
610
611         Back out a change that was incorrectly committed yesterday.
612
613         Reviewed by Chris.
614
615         * bindings/objc/objc_utility.mm:
616         (KJS::Bindings::convertValueToObjcValue):
617
618 2005-01-17  Richard Williamson   <rjw@apple.com>
619
620         Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
621
622         Keep track of originating execution context and target execution
623         context for native JS object wrappers, and perform appropriate
624         security checks.
625
626         Reviewed by David Harrison.
627
628         * bindings/NP_jsobject.cpp:
629         (_isSafeScript):
630         (_NPN_CreateScriptObject):
631         (_NPN_Invoke):
632         (_NPN_Evaluate):
633         (_NPN_GetProperty):
634         (_NPN_SetProperty):
635         (_NPN_RemoveProperty):
636         (_NPN_HasProperty):
637         (_NPN_HasMethod):
638         (_NPN_SetException):
639         * bindings/NP_jsobject.h:
640         * bindings/c/c_instance.cpp:
641         (CInstance::CInstance):
642         (CInstance::stringValue):
643         * bindings/c/c_instance.h:
644         * bindings/c/c_utility.cpp:
645         (convertValueToNPVariant):
646         * bindings/jni/jni_instance.cpp:
647         (JavaInstance::JavaInstance):
648         (JavaInstance::valueOf):
649         * bindings/jni/jni_instance.h:
650         * bindings/objc/WebScriptObject.mm:
651         (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
652         (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
653         (-[WebScriptObject KJS::Bindings::]):
654         (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
655         (-[WebScriptObject _isSafeScript]):
656         (-[WebScriptObject callWebScriptMethod:withArguments:]):
657         (-[WebScriptObject evaluateWebScript:]):
658         (-[WebScriptObject setValue:forKey:]):
659         (-[WebScriptObject valueForKey:]):
660         (-[WebScriptObject removeWebScriptKey:]):
661         (-[WebScriptObject stringRepresentation]):
662         (-[WebScriptObject webScriptValueAtIndex:]):
663         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
664         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
665         * bindings/objc/WebScriptObjectPrivate.h:
666         * bindings/objc/objc_instance.h:
667         * bindings/objc/objc_runtime.mm:
668         (convertValueToObjcObject):
669         * bindings/objc/objc_utility.mm:
670         (KJS::Bindings::convertValueToObjcValue):
671         * bindings/runtime.cpp:
672         (Instance::Instance):
673         (Instance::operator=):
674         * bindings/runtime.h:
675         (KJS::Bindings::Instance::Instance):
676         (KJS::Bindings::Instance::setExecutionContext):
677         (KJS::Bindings::Instance::executionContext):
678         * bindings/runtime_root.cpp:
679         (RootObject::setInterpreter):
680         * bindings/runtime_root.h:
681         * kjs/interpreter.h:
682         (KJS::Interpreter::isGlobalObject):
683         (KJS::Interpreter::interpreterForGlobalObject):
684         (KJS::Interpreter::isSafeScript):
685
686 === Safari-179 ===
687
688 2005-01-13  Vicki Murley <vicki@apple.com>
689
690         Reviewed by Adele.
691
692         - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
693  
694         * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
695
696 2005-01-12  Richard Williamson   <rjw@apple.com>
697
698         Avoid additional work on dealloc by adding early out to
699         removeNativeReference().  (This will save time on dealloc
700         for all ObjC DOM objects.)
701
702         Reviewed by Darin.
703
704         * bindings/runtime_root.cpp:
705         (KJS::Bindings::removeNativeReference):
706
707 2005-01-12  Richard Williamson   <rjw@apple.com>
708
709         Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
710
711         We were always returning the first "root" object for all runtime
712         objects.  Changed 0 in loop to i, the index.
713
714         Reviewed by David Harrison.
715
716         * bindings/runtime_root.cpp:
717         (KJS::Bindings::rootForImp):
718
719 2005-01-11  Richard Williamson   <rjw@apple.com>
720
721         Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
722
723         Use the new dispatching API to invoke JNI, rather than calling JNI
724         directly.
725
726         Reviewed by David Harrison.
727
728         * bindings/jni/jni_instance.cpp:
729         (JavaInstance::invokeMethod):
730         * bindings/jni/jni_runtime.cpp:
731         (JavaField::dispatchValueFromInstance):
732         (JavaField::valueFromInstance):
733         (JavaField::dispatchSetValueToInstance):
734         (JavaField::setValueToInstance):
735         * bindings/jni/jni_runtime.h:
736         * bindings/jni/jni_utility.cpp:
737         (KJS::Bindings::convertValueToJValue):
738
739 === Safari-178 ===
740
741 === Safari-177 ===
742
743 === Safari-176 ===
744
745 2004-12-17  Maciej Stachowiak  <mjs@apple.com>
746
747         Reviewed by Kevin.
748
749         <rdar://problem/3926869> Opening caches window after running PLT causes crash
750         
751         * kjs/protected_values.cpp:
752         (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
753         the protected value table.
754         (KJS::ProtectedValues::increaseProtectCount): Ditto.
755         (KJS::ProtectedValues::decreaseProtectCount): Ditto.
756
757 2004-12-16  Darin Adler  <darin@apple.com>
758
759         Reviewed by Maciej.
760
761         - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
762
763         * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
764         * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
765         non-locale-specific versions.
766         * kjs/string_object.lut.h: Regenerated.
767
768 2004-12-14  Richard Williamson   <rjw@apple.com>
769
770         Pass URL of plugin view when call into JNI.
771
772         Reviewed by Chris.
773
774         * bindings/jni/jni_objc.mm:
775         (KJS::Bindings::dispatchJNICall):
776
777 2004-12-13  Richard Williamson   <rjw@apple.com>
778
779         Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
780
781         Add support for calling static Java methods from JavaScript.
782
783         Reviewed by Maciej.
784
785         * bindings/jni/jni_instance.cpp:
786         (JavaInstance::invokeMethod):
787         * bindings/jni/jni_runtime.cpp:
788         (JavaMethod::JavaMethod):
789         * bindings/jni/jni_runtime.h:
790         (KJS::Bindings::JavaMethod::isStatic):
791         * bindings/jni/jni_utility.cpp:
792         (callJNIStaticMethod):
793         (KJS::Bindings::callJNIBooleanMethod):
794         (KJS::Bindings::callJNIStaticBooleanMethod):
795         * bindings/jni/jni_utility.h:
796
797 2004-12-13  Richard Williamson   <rjw@apple.com>
798
799         Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
800
801         Reviewed by John.
802
803         * bindings/jni/jni_instance.cpp:
804         (JavaInstance::invokeMethod):
805         * bindings/jni/jni_objc.mm:
806         (KJS::Bindings::dispatchJNICall):
807         * bindings/jni/jni_runtime.h:
808         * bindings/jni/jni_utility.h:
809
810 === Safari-175 ===
811
812 2004-12-07  Maciej Stachowiak  <mjs@apple.com>
813
814         Reviewed by Darin.
815
816         <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
817
818         The fix was to implement copy constructor and assignment operator,
819         the ones that worked on the base class did not replace the
820         defaults apparently!
821         
822         * kjs/protect.h:
823         (KJS::ProtectedValue::ProtectedValue):
824         (KJS::ProtectedValue::operator=):
825         (KJS::ProtectedObject::ProtectedObject):
826         (KJS::ProtectedObject::operator=):
827         
828         Also fixed a bug in the GC test mode that compares the results of
829         the old collector and the new collector.
830
831         * kjs/value.cpp:
832         (ValueImp::mark):
833
834 === Safari-173 ===
835
836 2004-11-23  Richard Williamson   <rjw@apple.com>
837
838         Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
839
840         Reviewed by Ken.
841
842         * bindings/c/c_class.cpp:
843         (CClass::_commonInit):
844
845 2004-11-21  Maciej Stachowiak  <mjs@apple.com>
846
847         Reviewed by Ken.
848
849         <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
850         
851         * kjs/collector.cpp:
852         (KJS::Collector::Thread::Thread):
853         (KJS::destroyRegisteredThread):
854         (KJS::initializeRegisteredThreadKey):
855         (KJS::Collector::registerThread):
856         (KJS::Collector::markStackObjectsConservatively):
857         (KJS::Collector::markCurrentThreadConservatively):
858         (KJS::Collector::markOtherThreadConservatively):
859         * kjs/collector.h:
860         * kjs/internal.cpp:
861         (lockInterpreter):
862         * kjs/value.h:
863
864 === Safari-172 ===
865
866 2004-11-15  Richard Williamson   <rjw@apple.com>
867
868         Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
869
870         Reviewed by Hyatt.
871
872         * bindings/objc/objc_instance.mm:
873         (ObjcInstance::stringValue):
874         * bindings/objc/objc_utility.h:
875         * bindings/objc/objc_utility.mm:
876         (KJS::Bindings::convertNSStringToString):
877         (KJS::Bindings::convertObjcValueToValue):
878
879 === Safari-171 ===
880
881 2004-11-09  Chris Blumenberg  <cblu@apple.com>
882
883         Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
884
885         Reviewed by rjw.
886
887         * ChangeLog:
888         * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
889         * bindings/softlinking.c: Added.
890         (loadFramework): new
891         (getFunctionPointer): new
892         (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
893
894 === Safari-170 ===
895
896 2004-11-04  Darin Adler  <darin@apple.com>
897
898         Reviewed by Ken.
899
900         - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
901         - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
902           and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
903           than allocating a new one
904
905         * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
906         (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
907         of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
908         actually allocate only the very first time it's called.
909         (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
910         shared instance since there can be only one).
911         (-[WebUndefined copyWithZone:]): Ditto.
912         (-[WebUndefined retain]): Ditto.
913         (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
914         of class).
915         (-[WebUndefined autorelease]): Simplified to just return self (see above).
916         (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
917         (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
918         a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
919         bug mentioned above).
920         (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
921         No need to call init, since that's a no-op for this class.
922
923 2004-11-03  David Harrison  <harrison@apple.com>
924
925         Reviewed by Darin.
926         
927         Eliminate the use of a marker file to determine how to build.
928
929         * .cvsignore:
930         * Makefile.am:
931
932 2004-11-01  Richard Williamson   <rjw@apple.com>
933
934         Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
935
936         Reviewed by Ken.
937
938         * bindings/c/c_instance.cpp:
939         (CInstance::invokeMethod):
940         (CInstance::invokeDefaultMethod):
941         Initialize out parameters to void type.
942
943         * bindings/c/c_runtime.cpp:
944         (CField::valueFromInstance):
945         (CField::setValueToInstance):
946         Initialize out parameters to void type.
947         Also added additional checks to protect against classes that 
948         don't implement all functions.
949
950 2004-11-01  Richard Williamson   <rjw@apple.com>
951
952         Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
953
954         Reviewed by John.
955
956         * ChangeLog:
957         * bindings/objc/WebScriptObject.mm:
958         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
959         Added additional conversion Undefined -> WebUndefined.
960         * bindings/objc/objc_utility.mm:
961         (KJS::Bindings::convertObjcValueToValue):
962         Added additional conversion WebUndefined -> Undefined.
963
964 2004-11-01  Darin Adler  <darin@apple.com>
965
966         - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
967
968         * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
969         this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
970         report to match the contents of the file.
971
972 === Safari-169 ===
973
974 === Safari-168 ===
975
976 2004-10-22  Ken Kocienda  <kocienda@apple.com>
977
978         Reviewed by me
979
980         * JavaScriptCore.pbproj/project.pbxproj:  
981         Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
982
983 === Safari-167 ===
984
985 2004-10-13  Richard Williamson   <rjw@apple.com>
986
987         Moved boolean checks prior to NSNumber checks.  booleans are
988         NSNumbers.
989
990         Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
991
992         Reviewed by John.
993
994         * bindings/objc/objc_utility.mm:
995         (KJS::Bindings::convertObjcValueToValue):
996
997 2004-10-12  Richard Williamson   <rjw@apple.com>
998
999         Fixed access to DOM object via WebScriptObject API.
1000         The execution context for DOM objects wasn't being found.       
1001         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
1002
1003         Reviewed by Chris.
1004
1005         * bindings/objc/WebScriptObject.mm:
1006         (_didExecute):
1007         (-[WebScriptObject KJS::Bindings::]):
1008         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1009         (-[WebScriptObject evaluateWebScript:]):
1010         (-[WebScriptObject setValue:forKey:]):
1011         (-[WebScriptObject valueForKey:]):
1012         (-[WebScriptObject stringRepresentation]):
1013         * bindings/objc/WebScriptObjectPrivate.h:
1014
1015 2004-10-09  Darin Adler  <darin@apple.com>
1016
1017         Reviewed by Kevin.
1018
1019         - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
1020
1021         * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
1022         creating an init routine.
1023
1024         * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
1025         require a global constructor that creates an init routine.
1026
1027 2004-10-09  Darin Adler  <darin@apple.com>
1028
1029         Reviewed by Kevin.
1030
1031         - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
1032
1033         * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
1034         work with the window object of the page the function is in, not the page of the caller. This
1035         is what all other browsers do. This code was hidden before by the "everything is defined on
1036         window object" hack in WebCore.
1037
1038 2004-10-07  Richard Williamson   <rjw@apple.com>
1039
1040         Added simple JavaScript call tracing.  Very useful for
1041         debugging complex pages.
1042
1043         Tracing is only available in development builds and is
1044         enabled by:
1045
1046         (gdb) set traceJavaScript = 1
1047
1048         or programatically
1049
1050         setTraceJavaScript(true)
1051
1052         Function, args, and return values are printed to console.  Very
1053         verbose.
1054
1055         Reviewed by Ken.
1056
1057         * kjs/function_object.cpp:
1058         (FunctionProtoFuncImp::call):
1059         * kjs/object.cpp:
1060         (KJS::Object::call):
1061
1062 === Safari-166 ===
1063
1064 2004-10-05  Richard Williamson   <rjw@apple.com>
1065
1066         Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
1067
1068         Reviewed by Chris.
1069
1070         * bindings/NP_jsobject.cpp:
1071         (_NPN_SetException):
1072         * bindings/npruntime.cpp:
1073         (_NPN_SetExceptionWithUTF8):
1074         * bindings/objc/WebScriptObject.mm:
1075         (+[WebScriptObject throwException:]):
1076         * kjs/internal.h:
1077         (KJS::InterpreterImp::context):
1078
1079 2004-10-05  Richard Williamson   <rjw@apple.com>
1080
1081         Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
1082
1083         Reviewed by Ken.
1084
1085         * bindings/objc/objc_utility.mm:
1086         (KJS::Bindings::convertObjcValueToValue):
1087
1088 2004-10-04  Darin Adler  <darin@apple.com>
1089
1090         Reviewed by Ken.
1091
1092         - rolled in a fix the KDE folks did for the operations that generate HTML fragments
1093
1094         * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
1095
1096         - rolled out an old workaround we don't need any more
1097
1098         * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
1099         required it is no longer there.
1100
1101 2004-09-30  Richard Williamson  <rjw@apple.com>
1102
1103         Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
1104
1105         Reviewed by Chris.
1106
1107         * bindings/NP_jsobject.cpp:
1108         (_NPN_GetProperty):
1109         (_NPN_HasProperty):
1110         (_NPN_HasMethod):
1111         * bindings/c/c_class.cpp:
1112         (CClass::methodsNamed):
1113         (CClass::fieldNamed):
1114         * bindings/c/c_class.h:
1115         * bindings/c/c_instance.cpp:
1116         (CInstance::invokeMethod):
1117         * bindings/jni/jni_class.cpp:
1118         (JavaClass::methodsNamed):
1119         * bindings/jni/jni_class.h:
1120         * bindings/npruntime.h:
1121         * bindings/objc/objc_class.h:
1122         * bindings/objc/objc_class.mm:
1123         (ObjcClass::methodsNamed):
1124         * bindings/runtime.h:
1125         * bindings/runtime_object.cpp:
1126         (RuntimeObjectImp::get):
1127         (RuntimeObjectImp::hasProperty):
1128
1129 2004-09-29  Chris Blumenberg  <cblu@apple.com>
1130
1131         Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
1132
1133         Reviewed by rjw.
1134
1135         * JavaScriptCore.pbproj/project.pbxproj:
1136         * bindings/NP_jsobject.cpp:
1137         (_NPN_CreateScriptObject):
1138         (_NPN_InvokeDefault):
1139         (_NPN_Invoke):
1140         (_NPN_Evaluate):
1141         (_NPN_GetProperty):
1142         (_NPN_SetProperty):
1143         (_NPN_RemoveProperty):
1144         (_NPN_HasProperty):
1145         (_NPN_HasMethod):
1146         * bindings/c/c_class.cpp:
1147         (CClass::methodsNamed):
1148         (CClass::fieldNamed):
1149         * bindings/c/c_instance.cpp:
1150         (CInstance::CInstance):
1151         (CInstance::~CInstance):
1152         (CInstance::operator=):
1153         (CInstance::invokeMethod):
1154         (CInstance::invokeDefaultMethod):
1155         * bindings/c/c_runtime.cpp:
1156         * bindings/c/c_runtime.h:
1157         (KJS::Bindings::CField::name):
1158         (KJS::Bindings::CMethod::name):
1159         * bindings/npruntime.cpp:
1160         (_NPN_GetStringIdentifier):
1161         (_NPN_GetStringIdentifiers):
1162         (_NPN_GetIntIdentifier):
1163         (_NPN_IdentifierIsString):
1164         (_NPN_UTF8FromIdentifier):
1165         (_NPN_IntFromIdentifier):
1166         (NPN_InitializeVariantWithObject):
1167         (_NPN_ReleaseVariantValue):
1168         (_NPN_CreateObject):
1169         (_NPN_RetainObject):
1170         (_NPN_ReleaseObject):
1171         (_NPN_SetExceptionWithUTF8):
1172         (_NPN_SetException):
1173
1174 2004-09-26  Darin Adler  <darin@apple.com>
1175
1176         * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
1177         low() to get Unicode value of character, and just use unicode().
1178
1179 2004-09-26  Darin Adler  <darin@apple.com>
1180
1181         - refine charAt/charCodeAt fix slightly
1182
1183         * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
1184         omitted parameter, as we do everywhere else, and as other browsers do here.
1185
1186 2004-09-26  Darin Adler  <darin@apple.com>
1187
1188         Reviewed by Kevin.
1189
1190         - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
1191
1192         * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
1193         the program. We were doing this properly for functions, but not entire programs.
1194
1195         - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
1196
1197         * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
1198         and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
1199
1200         * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
1201
1202 === Safari-165 ===
1203
1204 === Safari-164 ===
1205
1206 2004-09-14  Richard Williamson   <rjw@apple.com>
1207
1208         1.  Add class parameter to object allocation function.  This is somewhat redundant, given that
1209         the allocation function is in the class function vector, but people wanted to use the same
1210         allocation function for different classes.
1211         
1212         2.  Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
1213         
1214         3.  Add support for a default function on an object.  This is a feature that ActiveX supports,
1215         and will allow JavaScript code to be written that will look exactly the same for both ActiveX
1216         plugins and Netscape or WebKit plugins.  There are implementations included for the 'C' and
1217         'Objective-C' bindings.
1218         
1219         There bugs are covered by
1220         
1221         <rdar://problem/3776343> Support for default functions in the JavaScript bindings
1222         <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
1223         <rdar://problem/3674754> Need to implement latest npruntime.h
1224
1225         Reviewed by John.
1226
1227         * bindings/NP_jsobject.cpp:
1228         (jsAllocate):
1229         (NPN_InvokeDefault):
1230         (NPN_Invoke):
1231         * bindings/c/c_class.cpp:
1232         * bindings/c/c_instance.cpp:
1233         (CInstance::CInstance):
1234         (CInstance::operator=):
1235         (CInstance::invokeMethod):
1236         (CInstance::invokeDefaultMethod):
1237         * bindings/c/c_instance.h:
1238         * bindings/c/c_runtime.cpp:
1239         * bindings/c/c_runtime.h:
1240         * bindings/jni/jni_instance.cpp:
1241         (JavaInstance::invokeDefaultMethod):
1242         * bindings/jni/jni_instance.h:
1243         * bindings/npruntime.cpp:
1244         (NPN_CreateObject):
1245         * bindings/npruntime.h:
1246         * bindings/objc/WebScriptObject.h:
1247         * bindings/objc/objc_class.mm:
1248         (ObjcClass::fallbackObject):
1249         * bindings/objc/objc_instance.h:
1250         * bindings/objc/objc_instance.mm:
1251         (ObjcInstance::invokeDefaultMethod):
1252         * bindings/objc/objc_runtime.h:
1253         * bindings/objc/objc_runtime.mm:
1254         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1255         (ObjcFallbackObjectImp::get):
1256         (ObjcFallbackObjectImp::put):
1257         (ObjcFallbackObjectImp::canPut):
1258         (ObjcFallbackObjectImp::implementsCall):
1259         (ObjcFallbackObjectImp::call):
1260         (ObjcFallbackObjectImp::hasProperty):
1261         (ObjcFallbackObjectImp::deleteProperty):
1262         (ObjcFallbackObjectImp::defaultValue):
1263         * bindings/runtime.h:
1264         (KJS::Bindings::Class::fallbackObject):
1265         (KJS::Bindings::Instance::getValueOfUndefinedField):
1266         (KJS::Bindings::Instance::setValueOfUndefinedField):
1267         (KJS::Bindings::Instance::valueOf):
1268         * bindings/runtime_object.cpp:
1269         (RuntimeObjectImp::implementsCall):
1270         (RuntimeObjectImp::call):
1271         * bindings/runtime_object.h:
1272
1273 2004-09-13  Maciej Stachowiak  <mjs@apple.com>
1274
1275         Reviewed by Darin.
1276
1277         <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1278         
1279         * kjs/string_object.cpp:
1280         (StringProtoFuncImp::call): Replaced implementation of replace()
1281         method with function below...
1282         (replace): In order to avoid excessive allocation and copying,
1283         figure out the ranges of the original string and replacement
1284         strings to be assembled, instead of constantly creating new
1285         strings at each substitution. The old behavior is basically O(N^2)
1286         for a global replace on a pattern that matches many places in the
1287         string.
1288         (regExpIsGlobal): Helper function for the above.
1289         (expandSourceRanges): ditto
1290         (pushSourceRange): ditto
1291         (expandReplacements): ditto
1292         (pushReplacement): ditto
1293         * kjs/ustring.cpp:
1294         (KJS::UString::spliceSubstringsWithSeparators): New method that
1295         pieces together substring ranges of this string together with
1296         specified separators, all at one go.
1297         * kjs/ustring.h:
1298         (KJS::UString::Range::Range): Added new helper class to represent
1299         substring choices.
1300
1301 2004-09-14  Maciej Stachowiak  <mjs@apple.com>
1302
1303         Reviewed by Darin.
1304
1305         - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1306         
1307         * kjs/function.cpp:
1308         (KJS::GlobalFuncImp::call): Make sure to escape null
1309         characters. This is a bug in the new code that made part of the
1310         test fail.
1311
1312 2004-09-13  Darin Adler  <darin@apple.com>
1313
1314         Reviewed by Kevin and Maciej.
1315
1316         - new function to support fix for DIG bug in WebCore
1317
1318         * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1319         * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1320
1321 2004-09-12  Darin Adler  <darin@apple.com>
1322
1323         * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1324         of escape and unescape.
1325
1326 2004-09-12  Darin Adler  <darin@apple.com>
1327
1328         Reviewed by Maciej.
1329
1330         - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1331
1332         * kjs/date_object.cpp:
1333         (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1334         uses CFDateFormatter.
1335         (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1336
1337 2004-09-09  Maciej Stachowiak  <mjs@apple.com>
1338
1339         Reviewed by Richard.
1340
1341         <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1342
1343         * kjs/function.cpp:
1344         (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1345         ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1346         * kjs/lexer.cpp:
1347         (Lexer::isHexDigit): Made static and non-const.
1348         * kjs/lexer.h:
1349
1350 === Safari-163 ===
1351
1352 2004-09-06  Darin Adler  <darin@apple.com>
1353
1354         * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1355
1356 === Safari-162 ===
1357
1358 2004-09-01  Richard Williamson   <rjw@apple.com>
1359
1360         Add pid to exception messages (to help debug dashboard clients).
1361
1362         Reviewed by Chris.
1363
1364         * kjs/interpreter.cpp:
1365         (Interpreter::evaluate):
1366
1367 === Safari-161 ===
1368
1369 2004-08-20  Richard Williamson   <rjw@apple.com>
1370
1371         Implemented new JNI abstraction.  We no longer invoke Java methods
1372         directly with JNI, rather we call into the plugin.  This allows the
1373         plugin to dispatch the call to the appropriate VM thread.  This
1374         change should (will?) fix a whole class of threading related problems with
1375         the Java VM.
1376
1377         Reviewed by Hyatt.
1378
1379         * JavaScriptCore.pbproj/project.pbxproj:
1380         * bindings/c/c_instance.h:
1381         (KJS::Bindings::CInstance::setExecutionContext):
1382         (KJS::Bindings::CInstance::executionContext):
1383         * bindings/jni/jni_instance.cpp:
1384         (JavaInstance::JavaInstance):
1385         (JavaInstance::invokeMethod):
1386         (JavaInstance::setExecutionContext):
1387         (JavaInstance::executionContext):
1388         * bindings/jni/jni_instance.h:
1389         * bindings/jni/jni_jsobject.cpp:
1390         (JSObject::convertJObjectToValue):
1391         * bindings/jni/jni_runtime.cpp:
1392         (JavaField::JavaField):
1393         (JavaArray::convertJObjectToArray):
1394         (JavaField::valueFromInstance):
1395         (JavaArray::JavaArray):
1396         (JavaArray::valueAt):
1397         * bindings/jni/jni_runtime.h:
1398         (KJS::Bindings::JavaArray::operator=):
1399         (KJS::Bindings::JavaArray::executionContext):
1400         * bindings/jni/jni_utility.h:
1401         * bindings/objc/objc_instance.h:
1402         (KJS::Bindings::ObjcInstance::setExecutionContext):
1403         (KJS::Bindings::ObjcInstance::executionContext):
1404         * bindings/runtime.cpp:
1405         (Instance::createBindingForLanguageInstance):
1406         * bindings/runtime.h:
1407         * bindings/runtime_root.h:
1408         (KJS::Bindings::RootObject::nativeHandle):
1409
1410 === Safari-158 ===
1411
1412 2004-08-19  Vicki Murley  <vicki@apple.com>
1413
1414         Reviewed by John.
1415
1416         * kjs/property_map.cpp:
1417         (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1418
1419 2004-08-17  Darin Adler  <darin@apple.com>
1420
1421         Reviewed by Adele.
1422
1423         - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1424
1425         * kjs/property_map.h: Added some private functions.
1426         * kjs/property_map.cpp:
1427         (KJS::PropertyMap::clear): Set sentinelCount to 0.
1428         (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1429         Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1430         (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1431         (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1432         (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1433         deleted-element sentinels.
1434         (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1435
1436 2004-08-16  Maciej Stachowiak  <mjs@apple.com>
1437
1438         Code change by Eric Albert, reviewd by me.
1439
1440         <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1441
1442         * kjs/date_object.cpp:
1443         (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1444         entirely would be even better, but is not required to fix this bug.
1445
1446 === Safari-157 ===
1447
1448 2004-08-16  Richard Williamson   <rjw@apple.com>
1449
1450         Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1451
1452         Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1453
1454         Reviewed by Chris.
1455
1456         * bindings/NP_jsobject.cpp:
1457         (NPN_Evaluate):
1458         * bindings/jni/jni_jsobject.cpp:
1459         (JSObject::eval):
1460         * bindings/objc/WebScriptObject.mm:
1461         (-[WebScriptObject evaluateWebScript:]):
1462
1463 2004-08-15  Richard Williamson   <rjw@apple.com>
1464
1465         More updates to np headers.  Implemented new NPN functions.
1466
1467         Reviewed by Darin.
1468
1469         * bindings/NP_jsobject.cpp:
1470         (NPN_HasProperty):
1471         (NPN_HasMethod):
1472         * bindings/npapi.h:
1473         * bindings/npruntime.h:
1474
1475 2004-08-13  Darin Adler  <darin@apple.com>
1476
1477         - fix build so we can compile again
1478
1479         * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1480         is good enough so that we can compile, but it's only a stopgap measure, because I think
1481         Richard has a newer one he wants to check in.
1482
1483 2004-08-12  Richard Williamson   <rjw@apple.com>
1484
1485         Bring npruntime.h and friends closer to compliance with
1486         latest spec.
1487
1488         Reviewed by Maciej.
1489
1490         * JavaScriptCore.pbproj/project.pbxproj:
1491         * bindings/NP_jsobject.cpp:
1492         (jsAllocate):
1493         (_NPN_CreateScriptObject):
1494         (NPN_Call):
1495         (NPN_Evaluate):
1496         (NPN_GetProperty):
1497         (NPN_SetProperty):
1498         (NPN_RemoveProperty):
1499         * bindings/NP_jsobject.h:
1500         * bindings/c/c_instance.cpp:
1501         (CInstance::invokeMethod):
1502         * bindings/c/c_utility.cpp:
1503         (convertNPVariantToValue):
1504         * bindings/npruntime.cpp:
1505         (NPN_IdentifierIsString):
1506         (NPN_VariantIsVoid):
1507         (NPN_VariantIsNull):
1508         (NPN_VariantIsUndefined):
1509         (NPN_VariantIsBool):
1510         (NPN_VariantIsInt32):
1511         (NPN_VariantIsDouble):
1512         (NPN_VariantIsString):
1513         (NPN_VariantIsObject):
1514         (NPN_VariantToBool):
1515         (NPN_VariantToString):
1516         (NPN_VariantToInt32):
1517         (NPN_VariantToDouble):
1518         (NPN_VariantToObject):
1519         (NPN_InitializeVariantAsVoid):
1520         (NPN_InitializeVariantAsNull):
1521         (NPN_InitializeVariantAsUndefined):
1522         (NPN_InitializeVariantWithBool):
1523         (NPN_InitializeVariantWithInt32):
1524         (NPN_InitializeVariantWithDouble):
1525         (NPN_InitializeVariantWithString):
1526         (NPN_InitializeVariantWithStringCopy):
1527         (NPN_InitializeVariantWithObject):
1528         (NPN_InitializeVariantWithVariant):
1529         (NPN_ReleaseVariantValue):
1530         (NPN_CreateObject):
1531         * bindings/npruntime.h:
1532         (_NPString::):
1533         (_NPString::_NPVariant::):
1534         * bindings/npruntime_priv.h: Added.
1535
1536 2004-08-12  Darin Adler  <darin@apple.com>
1537
1538         Reviewed by Adele.
1539
1540         - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1541
1542         * kjs/function.cpp:
1543         (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1544         (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1545         (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1546         to skip leading "+" or "-".
1547
1548 === Safari-156 ===
1549
1550 2004-08-12  Darin Adler  <darin@apple.com>
1551
1552         Reviewed by Ken.
1553
1554         - fixed 43 Mozilla JavaScript tests
1555
1556         * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1557         * kjs/date_object.cpp:
1558         (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1559         than constructing a number object to pass to it.
1560         (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1561         (KJS::parseDate): Change to return a double instead of creating the Number object here.
1562         (KJS::timeClip): Implement this as specified in the language standard.
1563
1564         * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1565         flags on the prototype property.
1566
1567         * kjs/function.cpp:
1568         (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1569         currently in scope.
1570         (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1571         file later.
1572         (KJS::parseDigit): Added. Helper function for parseInt.
1573         (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1574         strtoll can handle. Also matches standard more closely.
1575         (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1576         instead of 0.
1577         (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1578
1579         * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1580
1581         * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1582         * kjs/lexer.cpp:
1583         (Lexer::setCode): Clear error state.
1584         (Lexer::lex): Set error state if the lexer encounters an error
1585
1586         * kjs/internal.cpp:
1587         (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1588         (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1589
1590         * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1591         Change round to round values between -0.5 and -0 to -0 instead of +0.
1592
1593         * kjs/nodes.h: Add evaluateReference function to GroupNode.
1594         * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1595         expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1596         would change x.y into a value that can't be deleted as a side effect.
1597
1598         * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1599         the specification.
1600
1601         * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1602         get rid of the fixed size limit for code.
1603
1604         * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1605         returns the string without creating a new Rep, since I'm using substr in a place where it will
1606         often be passed a 0.
1607
1608         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1609         the other day that was making a couple tests fail.
1610         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1611         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1612         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1613         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1614         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1615
1616         * kjs/string_object.lut.h: Regenerated.
1617
1618 2004-08-11  Darin Adler  <darin@apple.com>
1619
1620         - fixed a tiny problem with the UTF-16 PCRE check-in
1621
1622         * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1623         the ctype_meta flag to get set in items that should not have it.
1624
1625         * pcre/chartables.c: Regenerated.
1626
1627 2004-08-10  Richard Williamson   <rjw@apple.com>
1628
1629         Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1630
1631         The following WebScripting methods are now supported on bound
1632         objects:
1633
1634         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1635         - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1636         - (id)valueForUndefinedKey:(NSString *)key
1637
1638         Reviewed by Chris.
1639
1640         * bindings/c/c_class.cpp:
1641         (CClass::fieldNamed):
1642         * bindings/c/c_class.h:
1643         * bindings/jni/jni_class.cpp:
1644         (JavaClass::fieldNamed):
1645         * bindings/jni/jni_class.h:
1646         * bindings/objc/objc_class.h:
1647         (KJS::Bindings::ObjcClass::isa):
1648         * bindings/objc/objc_class.mm:
1649         (ObjcClass::methodsNamed):
1650         (ObjcClass::fieldNamed):
1651         (ObjcClass::fallbackObject):
1652         * bindings/objc/objc_instance.h:
1653         * bindings/objc/objc_instance.mm:
1654         (ObjcInstance::invokeMethod):
1655         (ObjcInstance::setValueOfField):
1656         (ObjcInstance::setValueOfUndefinedField):
1657         (ObjcInstance::getValueOfField):
1658         (ObjcInstance::getValueOfUndefinedField):
1659         * bindings/objc/objc_runtime.h:
1660         (KJS::Bindings::ObjcField::~ObjcField):
1661         (KJS::Bindings::ObjcField::ObjcField):
1662         (KJS::Bindings::ObjcField::operator=):
1663         (KJS::Bindings::FallbackObjectImp::classInfo):
1664         * bindings/objc/objc_runtime.mm:
1665         (ObjcField::ObjcField):
1666         (ObjcField::name):
1667         (ObjcField::type):
1668         (ObjcField::valueFromInstance):
1669         (ObjcField::setValueToInstance):
1670         (FallbackObjectImp::FallbackObjectImp):
1671         (FallbackObjectImp::get):
1672         (FallbackObjectImp::put):
1673         (FallbackObjectImp::canPut):
1674         (FallbackObjectImp::implementsCall):
1675         (FallbackObjectImp::call):
1676         (FallbackObjectImp::hasProperty):
1677         (FallbackObjectImp::deleteProperty):
1678         (FallbackObjectImp::defaultValue):
1679         * bindings/runtime.h:
1680         (KJS::Bindings::Class::fallbackObject):
1681         (KJS::Bindings::Instance::getValueOfUndefinedField):
1682         (KJS::Bindings::Instance::setValueOfUndefinedField):
1683         * bindings/runtime_object.cpp:
1684         (RuntimeObjectImp::get):
1685         (RuntimeObjectImp::put):
1686         (RuntimeObjectImp::canPut):
1687         (RuntimeObjectImp::hasProperty):
1688         * bindings/testbindings.mm:
1689         (-[MyFirstInterface valueForUndefinedKey:]):
1690         (-[MyFirstInterface setValue:forUndefinedKey:]):
1691
1692 2004-08-10  Darin Adler  <darin@apple.com>
1693
1694         Reviewed by Dave.
1695
1696         - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1697
1698         * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1699         or uint16_t depending on the mode, and used appropriate in the 7 public functions
1700         that need to use it.
1701         * pcre/pcre.c: Add UTF-16 support to all functions.
1702         * pcre/study.c: Ditto.
1703
1704         * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1705         the mode. Changed declarations to use symbolic constants and typedefs so we size
1706         things to ichar when needed.
1707
1708         * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1709         sized to 16-bit characters instead of 8-bit.
1710
1711         * pcre/get.c:
1712         (pcre_copy_substring): Use pcre_char instead of char.
1713         (pcre_get_substring_list): Ditto.
1714         (pcre_free_substring_list): Ditto.
1715         (pcre_get_substring): Ditto.
1716         (pcre_free_substring): Ditto.
1717
1718         * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1719         of hard-coding 8-bit table sizes.
1720
1721         * pcre/chartables.c: Regenerated.
1722
1723         * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1724         * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1725         is not null. The null string still has a null pointer. This prevents us from
1726         passing a null through to the regular expression engine (which results in a null
1727         error even when the string length is 0).
1728
1729         * kjs/regexp.cpp:
1730         (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1731         (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1732
1733 2004-08-09  Darin Adler  <darin@apple.com>
1734
1735         Reviewed by Maciej.
1736
1737         - fixed 28 Mozilla JavaScript tests
1738
1739         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1740         checking the number of arguments for the join method.
1741
1742         * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1743         than integers, so we aren't limited to 32 bits.
1744
1745         * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1746         the implementation of the pow operation. Also simplied a case that was handling positive
1747         and negative infinity separately.
1748
1749         * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1750         putting them in a long, so that unsigned shift will work properly.
1751
1752         * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1753
1754         * kjs/operations.cpp:
1755         (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1756         sign of isinf; our isinf function returns +1 even for negative infinity.
1757         (KJS::isNegInf): And again.
1758         (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1759         Our floating point already handles the various infinity cases correctly.
1760
1761         * kjs/regexp_object.cpp:
1762         (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1763         (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1764         array in cases where we did not match.
1765         (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1766         "global", "ignoreCase", "multiline", and "source".
1767
1768         * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1769         string into undefined rather than an empty string. For the slice method, handle an
1770         undefined parameter for the limit properly as decribed in the specification, and add
1771         the limit to one case that didn't have the limit at all. For the methods that generate
1772         HTML strings, use lowercase tags instead of uppercase.
1773
1774         * kjs/ustring.cpp:
1775         (KJS::UChar::toLower): Use u_tolower from the ICU library.
1776         (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1777         (KJS::UString::append): Fix some math that caused a buffer overflow.
1778         (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1779         flag) rather than converting them all to 0.
1780         (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1781
1782         * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1783
1784         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1785         the Unicode specification in a few cases where it was wrong before.
1786         * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1787         * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1788         * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1789         * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1790         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1791         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1792         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1793         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1794         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1795
1796         * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1797
1798         * kjs/number_object.lut.h: Regenerated.
1799
1800 2004-08-09  Darin Adler  <darin@apple.com>
1801
1802         Reviewed by Maciej.
1803
1804         - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1805
1806         * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1807         we get a buffer overflow.
1808
1809 === Safari-155 ===
1810
1811 2004-08-05  Richard Williamson   <rjw@apple.com>
1812
1813         Fixed part of 3674747.  The QT guys need this for feature freeze.
1814
1815         This patch implements support for the
1816
1817         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1818
1819         method of objects bound to JavaScript.
1820
1821         Reviewed by John.
1822
1823         * ChangeLog:
1824         * bindings/objc/objc_class.mm:
1825         (ObjcClass::methodsNamed):
1826         (ObjcClass::fieldNamed):
1827         * bindings/objc/objc_instance.mm:
1828         (ObjcInstance::invokeMethod):
1829         * bindings/objc/objc_runtime.h:
1830         (KJS::Bindings::ObjcMethod::~ObjcMethod):
1831         (KJS::Bindings::ObjcMethod::isFallbackMethod):
1832         (KJS::Bindings::ObjcMethod::javaScriptName):
1833         * bindings/objc/objc_runtime.mm:
1834         (ObjcMethod::ObjcMethod):
1835         (ObjcMethod::getMethodSignature):
1836         (ObjcMethod::setJavaScriptName):
1837         * bindings/testbindings.mm:
1838
1839 2004-08-04  Vicki Murley  <vicki@apple.com>
1840
1841         Reviewed by mjs.
1842  
1843         - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error        
1844
1845         * kjs/lexer.cpp:
1846         (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1847         go to the next line and continue parsing the string (instead of failing).  This matches 
1848         behavior in Mac IE and Mozilla.
1849
1850 2004-08-03  Kevin Decker  <kdecker@apple.com>
1851
1852         Reviewed by Darin.
1853
1854         Rolled in changes from the latest KJS sources that support additional 
1855         Number.prototype functions. 
1856
1857         Specifically this patch covers the follow parts of the ECMA 3 spec:
1858         15.7.4.5, 15.7.4.6, and 15.7.4.7 
1859         
1860         Fixes:
1861         <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1862         <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1863         <rdar://problem/3749591> missing Number.toExponential prototype implementation
1864
1865         * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1866         list of supported identifiers (a macro).
1867         * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1868         and toExponential(). 
1869         (NumberPrototypeImp::NumberPrototypeImp):
1870         (NumberProtoFuncImp::call):
1871         * kjs/number_object.h: Added property names for toFixed, toPrecision,
1872         and toExponential. 
1873         (KJS::NumberProtoFuncImp::):
1874         * tests/mozilla/expected.html: Update results.
1875
1876 2004-08-03  Darin Adler  <darin@apple.com>
1877
1878         Reviewed by Ken.
1879
1880         - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1881
1882         * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1883         we are supposed to just copy the regular expression object, and do so.
1884         Also tighten up arguments check to handle case where an actual "undefined"
1885         is passed rather than just omitting an argument.
1886
1887         * tests/mozilla/expected.html: Update results.
1888
1889 2004-08-02  Darin Adler  <darin@apple.com>
1890
1891         * tests/mozilla/.cvsignore: Added.
1892         * tests/mozilla/expected.html: Update results.
1893
1894 2004-08-02  Darin Adler  <darin@apple.com>
1895
1896         Reviewed by Ken.
1897
1898         - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1899
1900         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1901         Append the flags here so more tests paseed.
1902
1903 2004-08-02  Darin Adler  <darin@apple.com>
1904
1905         Reviewed by Ken.
1906
1907         - fixed a couple things making 5 Mozilla regexp tests pass
1908
1909         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1910         for the prototype.
1911         (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1912         be used as the flags string when no parameter was passed.
1913
1914         * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1915         Added a class info object for RegExp prototype so it can return
1916         a string instead of raising an exception when converting to a string.
1917
1918         * tests/mozilla/expected.html: Update results.
1919
1920 2004-08-02  Darin Adler  <darin@apple.com>
1921
1922         Reviewed by Kevin.
1923
1924         - fix crashes in mozilla tests due to mishandling NaN
1925
1926         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1927         calls to toInteger so that NaN will get turned into something that fits in an integer.
1928         These were the ones John already fixed, but his fix used isnan and the new fix is
1929         more efficient.
1930
1931         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1932         after a call to toInteger to handle NaN properly. Also removed separate check
1933         for undefined that's not needed.
1934
1935         * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1936         as in the above two files, but for a lot more functions. Also changed one place with
1937         an explicit check for undefined to instead just check isNaN.
1938
1939         * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1940         like me who don't keep $SYMROOTS in their $PATH.
1941
1942 === Safari-154 ===
1943
1944 === Safari-153 ===
1945
1946 2004-07-26  Kevin Decker  <kdecker@apple.com>
1947
1948         Changes done by Darin, reviewed by Kevin.
1949
1950         - changed testkjs to build in Xcode rather than from Makefile
1951
1952         * .cvsignore: Removed obsolete files from this list.
1953         * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1954         Changed to build target "All" rather than default target. This makes us
1955         build the testkjs test tool.
1956         * dummy.cpp: Removed.
1957         * kjs/.cvsignore: Removed obsolete files from this list, including
1958         the testkjs tool, which is now built in the symroots directory.
1959         * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1960         changed this file. Also this has the nice side effect of causing the tool
1961         to be rebuilt in the new location even if there are no other changes in
1962         your tree when you check this out.
1963         * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1964         without setting the execute bit on jsDriver.pl.
1965
1966 2004-07-22  Kevin Decker  <kdecker@apple.com>
1967
1968         Reviewed by Darin
1969         
1970         Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions). 
1971
1972         * kjs/function_object.cpp:
1973         (FunctionObjectImp::construct):
1974         * kjs/function_object.h:
1975         * kjs/object.cpp:
1976         (KJS::ObjectImp::construct):
1977         * kjs/object.h:
1978         (KJS::Object::construct):
1979
1980 2004-07-21  Darin Adler  <darin@apple.com>
1981
1982         * bindings/npruntime.h: Fixed typo.
1983
1984 2004-07-19  John Sullivan  <sullivan@apple.com>
1985
1986         Reviewed by Maciej.
1987         
1988         - bulletproofed array.slice() against NAN arguments. Harri noticed this
1989         vulnerability in my patch for 3714644
1990
1991         * kjs/array_object.cpp:
1992         (ArrayProtoFuncImp::call):
1993         handle NAN parameters passed to slice() by clamping to 0 and length.
1994
1995 2004-07-19  Richard Williamson   <rjw@apple.com>
1996
1997         Fixed 3733349.  Prevent Java applet callbacks into JavaScript after applet
1998         has been destroyed.
1999
2000         Reviewed by John.
2001
2002         * bindings/jni/jni_jsobject.cpp:
2003         (JSObject::invoke):
2004         (JSObject::JSObject):
2005
2006 2004-07-16  John Sullivan  <sullivan@apple.com>
2007
2008         Reviewed by Maciej.
2009         
2010         - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link 
2011         hangs browser with javascript
2012
2013         * kjs/array_object.cpp:
2014         (ArrayProtoFuncImp::call):
2015         Check for undefined type for args[0] the same way we were already checking
2016         for args[1]. In this case, args was zero-length, but we were treating
2017         args[0] like an integer anyway. Resulted in some code looping from a NAN
2018         value to 4, taking approximately forever.
2019
2020         * JavaScriptCore.pbproj/project.pbxproj:
2021         version wars
2022         
2023 === Safari-152 ===
2024
2025 2004-07-14  Maciej Stachowiak  <mjs@apple.com>
2026
2027         Reviewed by John.
2028
2029         <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
2030         <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
2031
2032         * kjs/number_object.cpp:
2033         (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
2034
2035 2004-07-13  Kevin Decker  <kdecker@apple.com>
2036
2037         Reviewed by kocienda.
2038
2039         - made testkjs and JavaScriptCore a subtarget of 'All'
2040         - testkjs now builds in $SYMROOTS
2041
2042         * JavaScriptCore.pbproj/project.pbxproj:
2043
2044 === Safari-151 ===
2045
2046 2004-06-24  Chris Blumenberg  <cblu@apple.com>
2047
2048         Ignore .mode1 files in JavaScriptCore.pbproj
2049
2050         Reviewed by kocienda.
2051
2052         * JavaScriptCore.pbproj/.cvsignore:
2053
2054 2004-06-23  Richard Williamson   <rjw@apple.com>
2055
2056         Implemented changes for latest npruntime.h.
2057         
2058         Reviewed by Chris.
2059
2060         * JavaScriptCore.pbproj/project.pbxproj:
2061         * bindings/NP_jsobject.cpp:
2062         (listFromVariantArgs):
2063         (identiferFromNPIdentifier):
2064         (_NPN_CreateScriptObject):
2065         (NPN_Call):
2066         (NPN_Evaluate):
2067         (NPN_GetProperty):
2068         (NPN_SetProperty):
2069         (NPN_RemoveProperty):
2070         * bindings/NP_jsobject.h:
2071         * bindings/c/c_class.cpp:
2072         (CClass::methodsNamed):
2073         (CClass::fieldNamed):
2074         * bindings/c/c_instance.cpp:
2075         (CInstance::invokeMethod):
2076         * bindings/c/c_utility.cpp:
2077         (convertNPVariantToValue):
2078         * bindings/c/c_utility.h:
2079         * bindings/npruntime.cpp:
2080         (stringIdentifierEqual):
2081         (stringIdentifierHash):
2082         (getStringIdentifierDictionary):
2083         (intIdentifierEqual):
2084         (intIdentifierHash):
2085         (getIntIdentifierDictionary):
2086         (NPN_GetStringIdentifier):
2087         (NPN_GetStringIdentifiers):
2088         (NPN_GetIntIdentifier):
2089         (NPN_IdentifierIsString):
2090         (NPN_UTF8FromIdentifier):
2091         (NPN_VariantToInt32):
2092         (NPN_VariantToDouble):
2093         (NPN_SetException):
2094         * bindings/npruntime.h:
2095         * bindings/objc/WebScriptObject.mm:
2096         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2097         * bindings/runtime_object.cpp:
2098         (RuntimeObjectImp::~RuntimeObjectImp):
2099         * bindings/runtime_root.cpp:
2100         (KJS::Bindings::rootForInterpreter):
2101         * bindings/testbindings.cpp:
2102         (initializeIdentifiers):
2103         (logMessage):
2104         (setDoubleValue):
2105         (setIntValue):
2106         (setBooleanValue):
2107
2108 === JavaScriptCore-146.1 ===
2109
2110 2004-06-16  Richard Williamson   <rjw@apple.com>
2111
2112         Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
2113
2114         This turned out to be a show stopper for Dashboard.  Accessing a nil
2115         ObjC property from JS caused a crash.  Similar to the problem
2116         3696112 fixed below.
2117         
2118         Reviewed by Trey.
2119
2120         * bindings/objc/objc_runtime.mm:
2121         (KJS::Bindings::ObjcField::valueFromInstance):
2122
2123 === Safari-146 ===
2124
2125 2004-06-16  Richard Williamson   <rjw@apple.com>
2126
2127         Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
2128
2129         This turned out to be a show stopper for Dashboard.  We now
2130         return Undefined() when nil is returned from a ObjC method
2131         that returns an object type.
2132         
2133         Reviewed by Maciej.
2134
2135         * bindings/objc/objc_utility.mm:
2136         (KJS::Bindings::convertObjcValueToValue):
2137
2138 === Safari-145 ===
2139
2140 2004-06-15  Richard Williamson   <rjw@apple.com>
2141
2142         Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
2143
2144         No longer need to check respondsToSelector: for
2145         isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
2146         because these now have a default implementation on NSObject.
2147
2148         Reviewed by Trey.
2149
2150         * bindings/objc/objc_class.mm:
2151         (ObjcClass::methodsNamed):
2152         (ObjcClass::fieldNamed):
2153
2154 2004-06-14  Darin Adler  <darin@apple.com>
2155
2156         Reviewed by Maciej.
2157
2158         - fixed some things for GC that Patrick missed, or that happened after the branch
2159
2160         * bindings/objc/WebScriptObject.mm:
2161         (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
2162         (-[WebScriptObject finalize]): Added.
2163
2164         - added some missing nil checks
2165
2166         * bindings/objc/objc_instance.mm:
2167         (ObjcInstance::ObjcInstance): Check for nil.
2168         (ObjcInstance::~ObjcInstance): Check for nil.
2169         (ObjcInstance::operator=): Check for nil.
2170
2171 2004-06-14  Darin Adler  <darin@apple.com>
2172
2173         Reviewed by me, code changes by Patrick Beard.
2174
2175         - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
2176
2177         * bindings/objc/objc_instance.mm:
2178         (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
2179         (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
2180         (ObjcInstance::operator=): More of the same.
2181         (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
2182
2183         * bindings/objc/objc_runtime.mm:
2184         (ObjcArray::ObjcArray): Use CFRetain instead of retain.
2185         (ObjcArray::~ObjcArray): Use CFRelease instead of release.
2186         (ObjcArray::operator=): More of the same.
2187
2188         * bindings/testbindings.mm: Fixed incorrect license.
2189         (main): Use [pool drain] if compiling on Tiger.
2190
2191 === Safari-144 ===
2192
2193 2004-06-10  Kevin Decker  <kdecker@apple.com>
2194
2195         Reviewed by John.
2196
2197         * kjs/lexer.cpp: 
2198         (Lexer::setCode):
2199             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2200         * kjs/lexer.h:
2201         (KJS::Lexer::lineNo):
2202             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2203
2204 === JavaScriptCore-143.2 ===
2205
2206 2004-06-07  Darin Adler  <darin@apple.com>
2207
2208         - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
2209
2210         * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
2211         * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
2212
2213 === JavaScriptCore-143.1 ===
2214
2215 2004-06-04  Kevin Decker  <kdecker@apple.com>
2216
2217         Reviewed by Darin
2218         
2219         - fixed <rdar://problem/3680594>
2220
2221         * kjs/object.cpp:
2222         (KJS::Error::create):
2223
2224 === Safari-143 ===
2225
2226 2004-06-04  Darin Adler  <darin@apple.com>
2227
2228         * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
2229
2230 2004-06-04  Kevin Decker  <kdecker@apple.com>
2231
2232         Reviewed by Dave.
2233
2234         - ObjC bindings do not (yet) pass along sourceurl or line numbers
2235         - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
2236         - changed the wording of an error message
2237         - the lexer, parser, and interpreter have been made "sourceURL aware"
2238         - stored the url into Error
2239          
2240         * bindings/NP_jsobject.cpp:
2241         (NPN_Evaluate):
2242         * bindings/jni/jni_jsobject.cpp:
2243         (JSObject::eval):
2244         * bindings/objc/WebScriptObject.mm:
2245         (-[WebScriptObject evaluateWebScript:]):
2246         * kjs/function.cpp:
2247         (GlobalFuncImp::call):
2248         * kjs/function_object.cpp:
2249         (FunctionObjectImp::construct):
2250         * kjs/internal.cpp:
2251         (Parser::parse):
2252         (InterpreterImp::checkSyntax):
2253         (InterpreterImp::evaluate):
2254         * kjs/internal.h:
2255         * kjs/interpreter.cpp:
2256         (Interpreter::evaluate):
2257         * kjs/interpreter.h:
2258         * kjs/lexer.cpp:
2259         (Lexer::setCode):
2260         * kjs/lexer.h:
2261         (KJS::Lexer::sourceURL):
2262         * kjs/nodes.cpp:
2263         (Node::Node):
2264         (Node::throwError):
2265         (FunctionCallNode::evaluate):
2266         * kjs/nodes.h:
2267         * kjs/object.cpp:
2268         (KJS::Error::create):
2269         * kjs/object.h:
2270
2271 2004-06-04  Richard Williamson   <rjw@apple.com>
2272
2273         Fixed crash when attempting to access properties on nil
2274         object.
2275         
2276         Reviewed by John.
2277
2278         * bindings/objc/objc_instance.mm:
2279         (ObjcInstance::getClass):
2280         * bindings/runtime_object.cpp:
2281         (RuntimeObjectImp::get):
2282         * bindings/testM.js:
2283         * bindings/testbindings.mm:
2284         (-[MyFirstInterface getString]):
2285
2286 2004-05-27  Kevin Decker  <kdecker@apple.com>
2287
2288         Reviewed by Ken.
2289
2290         -revised generated error message content
2291         
2292         * kjs/error_object.cpp:
2293         (ErrorProtoFuncImp::call):
2294         * kjs/internal.cpp:
2295         (Parser::parse):
2296         * kjs/object.cpp:
2297         (KJS::Error::create):
2298
2299 === Safari-142 ===
2300
2301 2004-05-27  Richard Williamson   <rjw@apple.com>
2302
2303         Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2304
2305         Reviewed by Chris.
2306
2307         * bindings/objc/WebScriptObject.h:
2308
2309 2004-05-27  Darin Adler  <darin@apple.com>
2310
2311         Reviewed by Maciej.
2312
2313         - moved to new symlink technique for embedding frameworks
2314
2315         * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2316         because we don't need it any more.
2317
2318 2004-05-24  Richard Williamson   <rjw@apple.com>
2319
2320         Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2321         fixed ClassInfo to correctly reflect inheritance.  This is required
2322         because of the runtime checks in JSC for arrays, i.e. in
2323         the Function objects apply method.
2324
2325         Reviewed by Ken.
2326
2327         * bindings/jni/jni_runtime.cpp:
2328         (JavaArray::convertJObjectToArray):
2329         * bindings/objc/objc_utility.mm:
2330         (KJS::Bindings::convertObjcValueToValue):
2331         * bindings/runtime_array.cpp:
2332         (RuntimeArrayImp::RuntimeArrayImp):
2333         * bindings/runtime_array.h:
2334         * bindings/testM.js: Added.
2335         * bindings/testbindings.mm:
2336         (+[MyFirstInterface webScriptNameForSelector:]):
2337         (-[MyFirstInterface logMessages:]):
2338         (-[MyFirstInterface logMessage:prefix:]):
2339         (-[MyFirstInterface callJSObject::]):
2340
2341 2004-05-22  Darin Adler  <darin@apple.com>
2342
2343         Reviewed by Maciej.
2344
2345         - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2346
2347         * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2348         with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2349         CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2350         it hasn't been set explicitly.
2351
2352 === Safari-141 ===
2353
2354 2004-05-20  Richard Williamson   <rjw@apple.com>
2355
2356         Implemented WebScriptObject/DOM wrapper voodoo.  DOM wrappers
2357         can now be referenced like any other WebScriptObject, meaning
2358         you can do JS operations on them.
2359
2360         All added implementation of finalizeForWebScript.
2361
2362         Reviewed by Ken.
2363
2364         * bindings/objc/WebScriptObject.h:
2365         * bindings/objc/WebScriptObject.mm:
2366         (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2367         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2368         (-[WebScriptObject KJS::]):
2369         (-[WebScriptObject dealloc]):
2370         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2371         (-[WebScriptObject evaluateWebScript:]):
2372         (-[WebScriptObject setValue:forKey:]):
2373         (-[WebScriptObject valueForKey:]):
2374         (-[WebScriptObject stringRepresentation]):
2375         * bindings/objc/WebScriptObjectPrivate.h:
2376         * bindings/objc/objc_instance.mm:
2377         (ObjcInstance::~ObjcInstance):
2378
2379 2004-05-19  Richard Williamson   <rjw@apple.com>
2380
2381         Removed extraneous tabs that were added (by XCode?).
2382
2383         * bindings/objc/WebScriptObject.h:
2384
2385 2004-05-19  Darin Adler  <darin@apple.com>
2386
2387         - fixed headers with licenses mangled by Xcode auto-indenting
2388
2389         * bindings/jni/jni_jsobject.cpp:
2390         * bindings/jni/jni_jsobject.h:
2391         * bindings/runtime_array.h:
2392         * bindings/runtime_root.cpp:
2393         * bindings/runtime_root.h:
2394
2395 2004-05-18  Richard Williamson   <rjw@apple.com>
2396
2397         Added exception logging.  Also check for exception and
2398         set results as appropriate.
2399
2400         Reviewed by Maciej (partially reviewed).
2401
2402         * bindings/objc/WebScriptObject.mm:
2403         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2404         (-[WebScriptObject evaluateWebScript:]):
2405         (-[WebScriptObject setValue:forKey:]):
2406         (-[WebScriptObject valueForKey:]):
2407
2408 2004-05-18  Richard Williamson   <rjw@apple.com>
2409
2410         Finsished implementing support for windowScriptObject.
2411         Had to make WebScriptObjectPrivate.h accessible from
2412         WebCore.
2413
2414         Reviewed by Maciej.
2415
2416         * JavaScriptCore.pbproj/project.pbxproj:
2417         * bindings/objc/WebScriptObjectPrivate.h:
2418
2419 2004-05-18  Richard Williamson   <rjw@apple.com>
2420
2421         Use KVC to set/get values instead of directly accessing
2422         ivars.
2423
2424         Reviewed by Maciej.
2425
2426         * bindings/objc/WebScriptObject.mm:
2427         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2428         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2429         * bindings/objc/objc_runtime.mm:
2430         (ObjcField::valueFromInstance):
2431         (convertValueToObjcObject):
2432         (ObjcField::setValueToInstance):
2433
2434 2004-05-17  Richard Williamson   <rjw@apple.com>
2435
2436         Implemented new API for WebScriptObject.
2437
2438         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2439         Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object)  (w/ help from Vicki)
2440
2441         Reviewed by Hyatt.
2442
2443         * JavaScriptCore.pbproj/project.pbxproj:
2444         * bindings/c/c_instance.cpp:
2445         (CInstance::invokeMethod):
2446         * bindings/jni/jni_instance.cpp:
2447         (JavaInstance::invokeMethod):
2448         * bindings/jni/jni_jsobject.cpp:
2449         (JSObject::convertValueToJObject):
2450         * bindings/jni/jni_utility.cpp:
2451         (KJS::Bindings::getJNIField):
2452         * bindings/objc/WebScriptObject.mm:
2453         (_didExecute):
2454         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2455         (-[WebScriptObject KJS::]):
2456         (-[WebScriptObject dealloc]):
2457         (+[WebScriptObject throwException:]):
2458         (listFromNSArray):
2459         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2460         (-[WebScriptObject evaluateWebScript:]):
2461         (-[WebScriptObject setValue:forKey:]):
2462         (-[WebScriptObject valueForKey:]):
2463         (-[WebScriptObject stringRepresentation]):
2464         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2465         (+[WebUndefined undefined]):
2466         (-[WebUndefined initWithCoder:]):
2467         (-[WebUndefined encodeWithCoder:]):
2468         (-[WebUndefined copyWithZone:]):
2469         (-[WebUndefined retain]):
2470         (-[WebUndefined release]):
2471         (-[WebUndefined retainCount]):
2472         (-[WebUndefined autorelease]):
2473         (-[WebUndefined dealloc]):
2474         (-[WebUndefined copy]):
2475         (-[WebUndefined replacementObjectForPortCoder:]):
2476         * bindings/objc/WebScriptObjectPrivate.h: Added.
2477         * bindings/objc/objc_class.mm:
2478         (ObjcClass::methodsNamed):
2479         (ObjcClass::fieldNamed):
2480         * bindings/objc/objc_instance.mm:
2481         (ObjcInstance::invokeMethod):
2482         * bindings/objc/objc_jsobject.h:
2483         * bindings/objc/objc_jsobject.mm:
2484         * bindings/objc/objc_runtime.mm:
2485         (ObjcField::valueFromInstance):
2486         * bindings/objc/objc_utility.mm:
2487         (KJS::Bindings::JSMethodNameToObjCMethodName):
2488         (KJS::Bindings::convertValueToObjcValue):
2489         (KJS::Bindings::convertObjcValueToValue):
2490         * bindings/runtime.cpp:
2491         (Instance::setDidExecuteFunction):
2492         (Instance::didExecuteFunction):
2493         (Instance::setValueOfField):
2494         * bindings/runtime.h:
2495         * bindings/testbindings.mm:
2496         (+[MyFirstInterface webScriptNameForSelector:]):
2497         (-[MyFirstInterface callJSObject::]):
2498
2499 2004-05-14  Vicki Murley  <vicki@apple.com>
2500
2501         Reviewed by mjs.
2502  
2503         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2504
2505         * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2506
2507 === Safari-140 ===
2508
2509 2004-05-13  Richard Williamson   <rjw@apple.com>
2510
2511         Fixed indentation.
2512
2513         Reviewed by Chris.
2514
2515         * ChangeLog:
2516         * bindings/objc/WebScriptObject.h:
2517
2518 2004-05-13  Richard Williamson   <rjw@apple.com>
2519
2520         Approved API changes.  Currently unimplemented.
2521
2522         Reviewed by Chris.
2523
2524         * ChangeLog:
2525         * JavaScriptCore.pbproj/project.pbxproj:
2526         * bindings/objc/WebScriptObject.h: Added.
2527         * bindings/objc/WebScriptObject.mm: Added.
2528         (+[WebScriptObject throwException:]):
2529         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2530         (-[WebScriptObject evaluateWebScript:]):
2531         (-[WebScriptObject stringRepresentation]):
2532         (+[WebUndefined undefined]):
2533         (-[WebUndefined initWithCoder:]):
2534         (-[WebUndefined encodeWithCoder:]):
2535         (-[WebUndefined copyWithZone:]):
2536
2537 2004-05-07  Vicki Murley  <vicki@apple.com>
2538
2539         Reviewed by darin.
2540
2541         Turn off GC since it uses ppc only instructions (which breaks 
2542         the B&I build).   
2543     
2544         * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2545
2546 === Safari-139 ===
2547
2548 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
2549
2550         Reviewed by Darin.
2551
2552         - add -funroll-loops=16 compiler option for approx .5% speedup on
2553         HTML iBench and .5-1% speedup on JS iBench.
2554         
2555         * JavaScriptCore.pbproj/project.pbxproj:
2556
2557 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
2558
2559         Reviewed by Darin.
2560
2561         Enable full conservative GC mode in addition to test mode. When
2562         conservative GC is enabled, we now get an 11% speed improvement on
2563         the iBench. Also fix some spots I missed before.
2564
2565         Specific noteworth changes:
2566         
2567         * kjs/collector.cpp:
2568         (KJS::Collector::markStackObjectsConservatively): Check possible
2569         cell pointers for 8-byte aligment and verify they are not 0.
2570
2571         * kjs/protected_values.cpp:
2572         (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2573         (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2574         * kjs/protect.h:
2575         (KJS::gcProtectNullTolerant): ...to here...
2576         (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2577         tolerance, and doing the check is expensive.
2578
2579         * kjs/protected_values.cpp:
2580         (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2581         that is still very good.
2582
2583         * kjs/protect.h:
2584         (KJS::gcProtect):
2585         (KJS::gcUnprotect):
2586         (KJS::ProtectedValue::ProtectedValue):
2587         (KJS::ProtectedValue::~ProtectedValue):
2588         (KJS::ProtectedValue::operator=):
2589         (KJS::ProtectedObject::ProtectedObject):
2590         (KJS::ProtectedObject::~ProtectedObject):
2591         (KJS::ProtectedObject::operator=):
2592         (KJS::ProtectedReference::ProtectedReference):
2593         (KJS::ProtectedReference::~ProtectedReference):
2594         (KJS::ProtectedReference::operator=):
2595         * kjs/protected_values.cpp:
2596         (KJS::ProtectedValues::getProtectCount):
2597         (KJS::ProtectedValues::increaseProtectCount):
2598         (KJS::ProtectedValues::decreaseProtectCount):
2599         (KJS::ProtectedValues::computeHash):
2600         * bindings/runtime_root.cpp:
2601         (KJS::Bindings::addNativeReference):
2602         (KJS::Bindings::removeNativeReference):
2603         (RootObject::removeAllNativeReferences):
2604         * bindings/runtime_root.h:
2605         (KJS::Bindings::RootObject::~RootObject):
2606         (KJS::Bindings::RootObject::setRootObjectImp):
2607         * kjs/collector.cpp:
2608         (KJS::Collector::allocate):
2609         (KJS::Collector::collect):
2610         * kjs/collector.h:
2611         * kjs/internal.cpp:
2612         (NumberImp::create):
2613         (InterpreterImp::globalInit):
2614         (InterpreterImp::globalClear):
2615         (InterpreterImp::mark):
2616         * kjs/list.cpp:
2617         (KJS::List::derefValues):
2618         (KJS::List::refValues):
2619         (KJS::List::append):
2620         * kjs/object.cpp:
2621         (KJS::ObjectImp::setInternalValue):
2622         (KJS::ObjectImp::putDirect):
2623         * kjs/value.cpp:
2624         (ValueImp::mark):
2625         (ValueImp::marked):
2626         * kjs/value.h:
2627         (KJS::ValueImp::ValueImp):
2628         (KJS::ValueImp::~ValueImp):
2629         (KJS::ValueImp::):
2630         (KJS::Value::Value):
2631         (KJS::Value::~Value):
2632         (KJS::Value::operator=):
2633
2634 2004-04-30  Richard Williamson   <rjw@apple.com>
2635
2636         Asking an NSInvocation for it's return value when return type
2637         is void throws an exception.  Added check for void return types
2638         to avoid this exception.
2639
2640         Reviewed by Ken.
2641
2642         * bindings/objc/objc_instance.mm:
2643         (ObjcInstance::invokeMethod):
2644
2645 2004-04-29  Richard Williamson   <rjw@apple.com>
2646
2647         Fixed several bad problems with the ObjC bindings.  In particular, conversion
2648         to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2649
2650         Reviewed by Chris.
2651
2652         * bindings/objc/objc_jsobject.h:
2653         * bindings/objc/objc_jsobject.mm:
2654         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2655         (-[JavaScriptObject KJS::]):
2656         (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2657         (-[JavaScriptObject call:arguments:]):
2658         (-[JavaScriptObject evaluate:]):
2659         (-[JavaScriptObject getMember:]):
2660         (-[JavaScriptObject getSlot:]):
2661         * bindings/objc/objc_runtime.mm:
2662         (ObjcField::valueFromInstance):
2663         (ObjcField::setValueToInstance):
2664         * bindings/objc/objc_utility.mm:
2665         (KJS::Bindings::convertValueToObjcValue):
2666         (KJS::Bindings::convertObjcValueToValue):
2667         * bindings/runtime.h:
2668         * bindings/runtime_root.cpp:
2669         (KJS::Bindings::rootForInterpreter):
2670         (KJS::Bindings::addNativeReference):
2671         (KJS::Bindings::removeNativeReference):
2672         * bindings/runtime_root.h:
2673         * bindings/testbindings.mm:
2674         (-[MyFirstInterface logMessage:]):
2675         (-[MyFirstInterface setJSObject:]):
2676         (-[MyFirstInterface callJSObject::]):
2677
2678 2004-04-24  Darin Adler  <darin@apple.com>
2679
2680         Reviewed by Dave.
2681
2682         * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2683         that is 2x too big.
2684
2685 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
2686
2687         Reviewed by Darin.
2688
2689         Implementation of conservative GC, based partly on code from
2690         Darin. It's turned off for now, so it shouldn't have any effect on
2691         the normal build.
2692         
2693         * JavaScriptCore.pbproj/project.pbxproj:
2694         * kjs/collector.cpp:
2695         (KJS::Collector::markStackObjectsConservatively):
2696         (KJS::Collector::markProtectedObjects):
2697         (KJS::Collector::collect):
2698         * kjs/collector.h:
2699         * kjs/protect.h:
2700         (KJS::gcProtect):
2701         (KJS::gcUnprotect):
2702         * kjs/protected_values.cpp: Added.
2703         (KJS::ProtectedValues::getProtectCount):
2704         (KJS::ProtectedValues::increaseProtectCount):
2705         (KJS::ProtectedValues::insert):
2706         (KJS::ProtectedValues::decreaseProtectCount):
2707         (KJS::ProtectedValues::expand):
2708         (KJS::ProtectedValues::shrink):
2709         (KJS::ProtectedValues::rehash):
2710         (KJS::ProtectedValues::computeHash):
2711         * kjs/protected_values.h: Added.
2712         * kjs/value.cpp:
2713         (ValueImp::useConservativeMark):
2714         (ValueImp::mark):
2715         (ValueImp::marked):
2716         * kjs/value.h:
2717         (KJS::ValueImp::):
2718
2719 === Safari-138 ===
2720
2721 2004-04-22  Richard Williamson   <rjw@apple.com>
2722
2723         Fixed build snafu (re-declaration of NPBool in npruntime.h and
2724         npapi.h).
2725
2726         * bindings/npruntime.h:
2727
2728 2004-04-22  Richard Williamson   <rjw@apple.com>
2729
2730         Updated plugin binding API to reflect latest revision from
2731         working group.
2732         
2733         Biggest change is the introduction of NPVariant used to represent
2734         value types.  NPVariant replaces the use of NPObject for the
2735         exchange of values between scripting environment and native code.
2736
2737         Reviewed by John.
2738
2739         * JavaScriptCore.pbproj/project.pbxproj:
2740         * bindings/NP_jsobject.cpp:
2741         (identiferFromNPIdentifier):
2742         (NPN_Call):
2743         (NPN_Evaluate):
2744         (NPN_GetProperty):
2745         (NPN_SetProperty):
2746         (NPN_ToString):
2747         (NPN_GetPropertyAtIndex):
2748         (NPN_SetPropertyAtIndex):
2749         * bindings/c/c_class.cpp:
2750         (CClass::methodsNamed):
2751         (CClass::fieldNamed):
2752         * bindings/c/c_instance.cpp:
2753         (CInstance::invokeMethod):
2754         (CInstance::defaultValue):
2755         * bindings/c/c_runtime.cpp:
2756         (CField::valueFromInstance):
2757         (CField::setValueToInstance):
2758         * bindings/c/c_utility.cpp:
2759         (convertNPStringToUTF16):
2760         (convertUTF8ToUTF16):
2761         (coerceValueToNPVariantStringType):
2762         (convertValueToNPVariant):
2763         (convertNPVariantToValue):
2764         * bindings/c/c_utility.h:
2765         * bindings/npruntime.cpp:
2766         (NPN_GetIdentifier):
2767         (NPN_GetIdentifiers):
2768         (NPN_UTF8FromIdentifier):
2769         (NPN_VariantIsVoid):
2770         (NPN_VariantIsNull):
2771         (NPN_VariantIsUndefined):
2772         (NPN_VariantIsBool):
2773         (NPN_VariantIsInt32):
2774         (NPN_VariantIsDouble):
2775         (NPN_VariantIsString):
2776         (NPN_VariantIsObject):
2777         (NPN_VariantToBool):
2778         (NPN_VariantToString):
2779         (NPN_VariantToInt32):
2780         (NPN_VariantToDouble):
2781         (NPN_VariantToObject):
2782         (NPN_InitializeVariantAsVoid):
2783         (NPN_InitializeVariantAsNull):
2784         (NPN_InitializeVariantAsUndefined):
2785         (NPN_InitializeVariantWithBool):
2786         (NPN_InitializeVariantWithInt32):
2787         (NPN_InitializeVariantWithDouble):
2788         (NPN_InitializeVariantWithString):
2789         (NPN_InitializeVariantWithStringCopy):
2790         (NPN_InitializeVariantWithObject):
2791         (NPN_InitializeVariantWithVariant):
2792         (NPN_ReleaseVariantValue):
2793         (NPN_CreateObject):
2794         (NPN_RetainObject):
2795         (NPN_ReleaseObject):
2796         (NPN_IsKindOfClass):
2797         (NPN_SetExceptionWithUTF8):
2798         (NPN_SetException):
2799         * bindings/npruntime.h:
2800         (_NPString::):
2801         (_NPString::_NPVariant::):
2802         * bindings/testbindings.cpp:
2803         (logMessage):
2804         (setDoubleValue):
2805         (setIntValue):
2806         (setStringValue):
2807         (setBooleanValue):
2808         (getDoubleValue):
2809         (getIntValue):
2810         (getStringValue):
2811         (getBooleanValue):
2812         (myGetProperty):
2813         (mySetProperty):
2814         (myInvoke):
2815         (myAllocate):
2816
2817 2004-04-22  Darin Adler  <darin@apple.com>
2818
2819         Reviewed by Maciej.
2820
2821         - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2822
2823         * kjs/ustring.cpp:
2824         (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2825         Was resulting in a buffer 2x the needed size.
2826         (KJS::UString::expandPreCapacity): Ditto.
2827         (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2828
2829 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
2830
2831         Reviewed by Darin.
2832
2833         Preliminary change for conservative GC. Create "protected"
2834         subclasses to GC-protect objects when on heap, since we will soon
2835         remove the built-in refcounting of the normal wrapper classes. Use
2836         them where needed.
2837         
2838         * JavaScriptCore.pbproj/project.pbxproj:
2839         * kjs/context.h:
2840         * kjs/internal.h:
2841         (KJS::InterpreterImp::globalObject):
2842         * kjs/interpreter.h:
2843         * kjs/property_map.cpp:
2844         * kjs/reference.h:
2845         * kjs/reference_list.cpp:
2846
2847 2004-04-19  Maciej Stachowiak  <mjs@apple.com>
2848
2849         Reviewed by Dave.
2850
2851         Optimize prepend using the shared substring optimization. Also,
2852         limit the applicability of shared append and shared prepend. If
2853         you overdo it, it does more harm than good, because you create a
2854         bunch of strings that are disqualified from future shared
2855         append/prepend, for not much immediate savings in allocate/copy
2856         expense.
2857         
2858         * kjs/ustring.cpp:
2859         (KJS::):
2860         (KJS::UString::Rep::create):
2861         (KJS::UString::expandedSize):
2862         (KJS::UString::usedPreCapacity):
2863         (KJS::UString::expandCapacity):
2864         (KJS::UString::expandPreCapacity):
2865         (KJS::UString::UString):
2866         (KJS::UString::append):
2867         (KJS::UString::operator=):
2868         * kjs/ustring.h:
2869         (KJS::UString::Rep::data):
2870
2871 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
2872         Reviewed by Richard.
2873
2874         No more need for Completion or Reference to privately inherit from
2875         Value, none of the superclass functionality is used.
2876
2877         * kjs/completion.h:
2878         * kjs/reference.h:
2879
2880 === Safari-137 ===
2881
2882 2004-04-16  Richard Williamson   <rjw@apple.com>
2883
2884         Added interpreter lock protection around object creation.
2885
2886         Reviewed by Chris.
2887
2888         * bindings/runtime.cpp:
2889         (Instance::createRuntimeObject):
2890
2891 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
2892
2893         Reviewed by Ken.
2894
2895         Another JavaScript speed improvement: use the mechanism from
2896         string append optimization to make taking a substring fast, again
2897         sharing the buffer.
2898
2899         A further 22% improvement on the 24fun string speed test.
2900         
2901         * kjs/ustring.cpp:
2902         (KJS::):
2903         (KJS::UString::Rep::create):
2904         (KJS::UString::UString):
2905         (KJS::UString::append):
2906         (KJS::UString::operator=):
2907         (KJS::UString::substr):
2908         * kjs/ustring.h:
2909         (KJS::UString::Rep::data):
2910
2911 2004-04-13  Maciej Stachowiak  <mjs@apple.com>
2912
2913         Reviewed by Darin.
2914
2915         - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2916         - fixed <rdar://problem/3600691>: Table generation test is really slow
2917         - fixed <rdar://problem/3600661>: 24fun date test is really slow
2918
2919         80% speedup on the string test, lesser speedups on the other two.
2920         
2921         Two different optimizations here:
2922
2923         1) Avoid large overhead of scanning strings to see if they are all
2924         ASCII before numeric conversion.
2925         
2926         * kjs/nodes.cpp:
2927         (AssignNode::evaluate): Don't convert to integer until we know for
2928         sure the operation will need it. Attempting to convert strings to
2929         numbers is a waste when they are being appended with +=.
2930
2931         2) Avoid huge cost of appending strings.
2932
2933         This is done by allowing multiple strings to share a buffer but
2934         actually use different ranges of it. The first time a string is
2935         appended to, we start leaving at least 10% extra space in the
2936         buffer, so doing N appends to the same string takes O(log N)
2937         mallocs instead of O(N).
2938         
2939         * kjs/identifier.cpp:
2940         (KJS::Identifier::equal):
2941         (KJS::Identifier::add):
2942         * kjs/ustring.cpp:
2943         (KJS::):
2944         (KJS::UCharReference::operator=):
2945         (KJS::UCharReference::ref):
2946         (KJS::UString::Rep::create):
2947         (KJS::UString::Rep::destroy):
2948         (KJS::UString::expandedSize):
2949         (KJS::UString::usedCapacity):
2950         (KJS::UString::expandCapacity):
2951         (KJS::UString::UString):
2952         (KJS::UString::null):
2953         (KJS::UString::append):
2954         (KJS::UString::operator=):
2955         (KJS::UString::toStrictUInt32):
2956         (KJS::UString::detach):
2957         (KJS::KJS::operator==):
2958         * kjs/ustring.h:
2959         (KJS::UString::Rep::data):
2960         (KJS::UString::Rep::hash):
2961
2962 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2963
2964         Reviewed by John.
2965
2966         - fix deployment build by avoiding deployment-only warning.
2967
2968         * kjs/scope_chain.cpp:
2969         (KJS::ScopeChain::bottom):
2970
2971 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2972
2973         Reviewed by John.
2974
2975         Changed things so that newly created objects get a prototype based
2976         on the scope chain of the current function, rather than the
2977         interpreter that started execution. This fixes the following bugs:
2978         
2979         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2980         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2981
2982         * JavaScriptCore.pbproj/project.pbxproj:
2983         * kjs/array_object.cpp:
2984         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2985         (ArrayProtoFuncImp::ArrayProtoFuncImp):
2986         (ArrayProtoFuncImp::call):
2987         (ArrayObjectImp::construct):
2988         * kjs/bool_object.cpp:
2989         (BooleanObjectImp::construct):
2990         * kjs/date_object.cpp:
2991         (DateProtoFuncImp::DateProtoFuncImp):
2992         (DateProtoFuncImp::call):
2993         (DateObjectImp::construct):
2994         * kjs/error_object.cpp:
2995         (ErrorObjectImp::construct):
2996         * kjs/function.cpp:
2997         (FunctionImp::FunctionImp):
2998         (FunctionImp::call):
2999         (DeclaredFunctionImp::construct):
3000         (ArgumentsImp::ArgumentsImp):
3001         (GlobalFuncImp::call):
3002         * kjs/function_object.cpp:
3003         (FunctionProtoFuncImp::call):
3004         (FunctionObjectImp::construct):
3005         * kjs/internal.cpp:
3006         (BooleanImp::toObject):
3007         (StringImp::toObject):
3008         (NumberImp::toObject):
3009         (InterpreterImp::InterpreterImp):
3010         (InterpreterImp::clear):
3011         (InterpreterImp::interpreterWithGlobalObject):
3012         * kjs/internal.h:
3013         * kjs/interpreter.cpp:
3014         (ExecState::lexicalInterpreter):
3015         * kjs/interpreter.h:
3016         (KJS::ExecState::dynamicInterpreter):
3017         (KJS::ExecState::interpreter):
3018         * kjs/math_object.cpp:
3019         (MathFuncImp::MathFuncImp):
3020         * kjs/nodes.cpp:
3021         (StatementNode::hitStatement):
3022         (StatementNode::abortStatement):
3023         (RegExpNode::evaluate):
3024         (ElementNode::evaluate):
3025         (ArrayNode::evaluate):
3026         (ObjectLiteralNode::evaluate):
3027         (PropertyValueNode::evaluate):
3028         (FunctionCallNode::evaluate):
3029         (FuncDeclNode::processFuncDecl):
3030         (FuncExprNode::evaluate):
3031         * kjs/number_object.cpp:
3032         (NumberObjectImp::construct):
3033         * kjs/object.cpp:
3034         (KJS::ObjectImp::defaultValue):
3035         (KJS::Error::create):
3036         * kjs/object_object.cpp:
3037         (ObjectObjectImp::construct):
3038         * kjs/reference.cpp:
3039         (Reference::putValue):
3040         * kjs/regexp_object.cpp:
3041         (RegExpProtoFuncImp::call):
3042         (RegExpObjectImp::arrayOfMatches):
3043         (RegExpObjectImp::construct):
3044         * kjs/scope_chain.cpp:
3045         (KJS::ScopeChain::bottom):
3046         * kjs/scope_chain.h:
3047         * kjs/string_object.cpp:
3048         (StringProtoFuncImp::StringProtoFuncImp):
3049         (StringProtoFuncImp::call):
3050         (StringObjectImp::construct):
3051
3052 === Safari-136 ===
3053
3054 === Safari-135 ===
3055
3056 2004-03-31  Richard Williamson   <rjw@apple.com>
3057
3058         Tedious renames based on feedback from plugin-futures list.
3059         NP_ functions are renamed with NPN_ prefix.
3060         Types prefix renamed from NP_ to NP.
3061         NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated. 
3062         
3063         No review because this was just a renaming patch.
3064
3065         * bindings/NP_jsobject.cpp:
3066         (listFromNPArray):
3067         (jsAllocate):
3068         (identiferFromNPIdentifier):
3069         (NPN_Call):
3070         (NPN_Evaluate):
3071         (NPN_GetProperty):
3072         (NPN_SetProperty):
3073         (NPN_RemoveProperty):
3074         (NPN_ToString):
3075         (NPN_GetPropertyAtIndex):
3076         (NPN_SetPropertyAtIndex):
3077         * bindings/NP_jsobject.h:
3078         * bindings/c/c_class.cpp:
3079         (CClass::_commonInit):
3080         (CClass::classForIsA):
3081         (CClass::CClass):
3082         (CClass::methodsNamed):
3083         (CClass::fieldNamed):
3084         * bindings/c/c_class.h:
3085         * bindings/c/c_instance.cpp:
3086         (CInstance::CInstance):
3087         (CInstance::~CInstance):
3088         (CInstance::operator=):
3089         (CInstance::invokeMethod):
3090         (CInstance::defaultValue):
3091         * bindings/c/c_instance.h:
3092         (KJS::Bindings::CInstance::getObject):
3093         * bindings/c/c_runtime.cpp:
3094         (CField::valueFromInstance):
3095         (CField::setValueToInstance):
3096         * bindings/c/c_runtime.h:
3097         (KJS::Bindings::CField::CField):
3098         (KJS::Bindings::CField::name):
3099         (KJS::Bindings::CMethod::CMethod):
3100         (KJS::Bindings::CMethod::name):
3101         * bindings/c/c_utility.cpp:
3102         (coerceValueToNPString):
3103         (convertValueToNPValueType):
3104         (convertNPValueTypeToValue):
3105         * bindings/c/c_utility.h:
3106         * bindings/npruntime.cpp:
3107         (NPN_IdentifierFromUTF8):
3108         (NPN_IsValidIdentifier):
3109         (NPN_GetIdentifiers):
3110         (NPN_UTF8FromIdentifier):
3111         (NPN_CreateObject):
3112         (NPN_RetainObject):
3113         (NPN_ReleaseObject):
3114         (NPN_IsKindOfClass):
3115         (NPN_SetExceptionWithUTF8):
3116         (NPN_SetException):
3117         (numberAllocate):
3118         (NPN_CreateNumberWithInt):
3119         (NPN_CreateNumberWithFloat):
3120         (NPN_CreateNumberWithDouble):
3121         (NPN_IntFromNumber):
3122         (NPN_FloatFromNumber):
3123         (NPN_DoubleFromNumber):
3124         (stringAllocate):
3125         (NPN_CreateStringWithUTF8):
3126         (NPN_CreateStringWithUTF16):
3127         (NPN_DeallocateUTF8):
3128         (NPN_UTF8FromString):
3129         (NPN_UTF16FromString):
3130         (NPN_StringLength):
3131         (booleanAllocate):
3132         (NPN_CreateBoolean):
3133         (NPN_BoolFromBoolean):
3134         (nullAllocate):
3135         (NPN_GetNull):
3136         (undefinedAllocate):
3137         (NPN_GetUndefined):
3138         (arrayAllocate):
3139         (arrayDeallocate):
3140         (NPN_CreateArray):
3141         (NPN_CreateArrayV):
3142         (NPN_ObjectAtIndex):
3143         * bindings/npruntime.h:
3144         * bindings/runtime.cpp:
3145         (Instance::createBindingForLanguageInstance):
3146         * bindings/testbindings.cpp:
3147         (initializeIdentifiers):
3148         (myHasProperty):
3149         (myHasMethod):
3150         (myGetProperty):
3151         (mySetProperty):
3152         (logMessage):
3153         (setDoubleValue):
3154         (setIntValue):
3155         (setStringValue):
3156         (setBooleanValue):
3157         (getDoubleValue):
3158         (getIntValue):
3159         (getStringValue):
3160         (getBooleanValue):
3161         (myInvoke):
3162         (myAllocate):
3163         (myInvalidate):
3164         (myDeallocate):
3165         (main):
3166
3167 2004-03-31  Richard Williamson   <rjw@apple.com>
3168
3169         Changed references to NP_runtime.h to npruntime.h
3170         
3171         * JavaScriptCore.pbproj/project.pbxproj:
3172         * bindings/NP_jsobject.h:
3173         * bindings/c/c_class.h:
3174         * bindings/c/c_instance.h:
3175         * bindings/c/c_runtime.h:
3176         * bindings/c/c_utility.h:
3177         * bindings/npruntime.cpp:
3178
3179 2004-03-31  Richard Williamson   <rjw@apple.com>
3180
3181         Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
3182
3183         * JavaScriptCore.pbproj/project.pbxproj:
3184         * bindings/NP_jsobject.h:
3185         * bindings/npruntime.cpp:
3186
3187 === Safari-134 ===
3188
3189 2004-03-23  Richard Williamson   <rjw@apple.com>
3190
3191         Added implementation of KJS::Value <-> NP_Object conversion functions.
3192         Augmented test program for 'C' bindings.
3193         Added asserts and parameter checking to all public API.        
3194
3195         Reviewed by Ken.
3196
3197         * JavaScriptCore.pbproj/project.pbxproj:
3198         * bindings/NP_jsobject.cpp:
3199         (NP_ToString):
3200         * bindings/NP_jsobject.h: Added.
3201         * bindings/NP_runtime.cpp:
3202         (NP_IdentifierFromUTF8):
3203         (NP_IsValidIdentifier):
3204         (NP_GetIdentifiers):
3205         (NP_CreateObject):
3206         (NP_RetainObject):
3207         (NP_ReleaseObject):
3208         (NP_IsKindOfClass):
3209         (NP_SetExceptionWithUTF8):
3210         (NP_SetException):
3211         (NP_IntFromNumber):
3212         (NP_FloatFromNumber):
3213         (NP_DoubleFromNumber):
3214         (NP_CreateStringWithUTF8):
3215         (NP_CreateStringWithUTF16):
3216         (NP_DeallocateUTF8):
3217         (NP_UTF8FromString):
3218         (NP_UTF16FromString):
3219         (NP_StringLength):
3220         (NP_BoolFromBoolean):
3221         * bindings/NP_runtime.h:
3222         * bindings/c/c_instance.cpp:
3223         (CInstance::invokeMethod):
3224         * bindings/c/c_utility.cpp:
3225         (coerceValueToNPString):
3226         (convertValueToNPValueType):
3227         (convertNPValueTypeToValue):
3228         * bindings/c/c_utility.h:
3229         * bindings/test.js:
3230         * bindings/testC.js: Added.
3231         * bindings/testbindings.cpp:
3232         (logMessage):
3233         (setDoubleValue):
3234         (setIntValue):
3235         (setStringValue):
3236         (setBooleanValue):
3237         (getDoubleValue):
3238         (getIntValue):
3239         (getStringValue):
3240         (getBooleanValue):
3241         (myInterfaceInvoke):
3242         (myInterfaceAllocate):
3243
3244 === Safari-133 ===
3245
3246 2004-03-19  Darin Adler  <darin@apple.com>
3247
3248         Reviewed by Ken.
3249
3250         - fixed problem with methods like setUTCHour
3251
3252         * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
3253         GMT vs. local time function based on the utc flag.
3254
3255 2004-03-17  Richard Williamson   <rjw@apple.com>
3256
3257         Added a context parameter to result callbacks use by JavaScriptObject functions.  This was a change requested by Eric Carlson on the QT plugin team.
3258
3259         Reviewed by Ken.
3260
3261         * bindings/NP_jsobject.cpp:
3262         (NP_Call):
3263         (NP_Evaluate):
3264         (NP_GetProperty):
3265         (NP_ToString):
3266         (NP_GetPropertyAtIndex):
3267         * bindings/NP_runtime.h:
3268
3269 2004-03-16  Richard Williamson   <rjw@apple.com>
3270
3271         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.
3272
3273         Reviewed by John.
3274
3275         * bindings/jni/jni_class.cpp:
3276         (JavaClass::methodsNamed):
3277
3278 2004-03-15  Richard Williamson   <rjw@apple.com>
3279
3280         Fixed 3570854.  Don't attempt to convert Null to strings.  We
3281         were incorrectly converting to "Null".
3282
3283         Actually fixed by Scott Kovatch.
3284
3285         Reviewed by Richard.
3286
3287         * bindings/jni/jni_utility.cpp:
3288         (KJS::Bindings::convertValueToJValue):
3289
3290 === Safari-132 ===
3291
3292 2004-03-11  Richard Williamson   <rjw@apple.com>
3293
3294         Stitched together the NP stuff to our language independent
3295         JavaScript binding stuff.  Very close to being done.
3296         
3297         Added program to test C bindings (and NP stuff).  Just tests
3298         properties.  Will add methods and JavaScript access, etc.
3299
3300         Updated Makefile.am to account for new bindings/c directory.
3301
3302         Change NP_UTF8 from "const char *" to "char" to allow for
3303         declarations like "const NP_UTF8 *" and "NP_UTF8 *".  Ditto
3304         for NP_UTF16.
3305
3306         Added NP_IsValidIdentifier().
3307
3308         Reviewed by Chris.
3309
3310         * JavaScriptCore.pbproj/project.pbxproj:
3311         * Makefile.am:
3312         * bindings/NP_jsobject.cpp:
3313         (identiferFromNPIdentifier):
3314         (NP_Evaluate):
3315         * bindings/NP_runtime.cpp:
3316         (NP_IdentifierFromUTF8):
3317         (NP_IsValidIdentifier):
3318         (NP_GetIdentifiers):
3319         (NP_UTF8FromIdentifier):
3320         (NP_SetExceptionWithUTF8):
3321         (NP_SetException):
3322         (NP_CreateStringWithUTF8):
3323         (NP_CreateStringWithUTF16):
3324         (NP_UTF8FromString):
3325         (NP_UTF16FromString):
3326         * bindings/NP_runtime.h:
3327         * bindings/c/c_class.cpp: Added.
3328         (CClass::_commonDelete):
3329         (CClass::_commonCopy):
3330         (CClass::_commonInit):
3331         (_createClassesByIsAIfNecessary):
3332         (CClass::classForIsA):
3333         (CClass::CClass):
3334         (CClass::name):
3335         (CClass::methodsNamed):
3336         (CClass::fieldNamed):
3337         * bindings/c/c_class.h: Added.
3338         (KJS::Bindings::CClass::~CClass):
3339         (KJS::Bindings::CClass::CClass):
3340         (KJS::Bindings::CClass::operator=):
3341         (KJS::Bindings::CClass::constructorAt):
3342         (KJS::Bindings::CClass::numConstructors):
3343         * bindings/c/c_instance.cpp: Added.
3344         (CInstance::CInstance):
3345         (CInstance::~CInstance):
3346         (CInstance::operator=):
3347         (CInstance::getClass):
3348         (CInstance::begin):
3349         (CInstance::end):
3350         (CInstance::invokeMethod):
3351         (CInstance::defaultValue):
3352         (CInstance::stringValue):
3353         (CInstance::numberValue):
3354         (CInstance::booleanValue):
3355         (CInstance::valueOf):
3356         * bindings/c/c_instance.h: Added.
3357         (KJS::Bindings::CInstance::getObject):
3358         * bindings/c/c_runtime.cpp: Added.
3359         (CField::valueFromInstance):
3360         (CField::setValueToInstance):
3361         * bindings/c/c_runtime.h: Added.
3362         (KJS::Bindings::CField::CField):
3363         (KJS::Bindings::CField::name):
3364         (KJS::Bindings::CField::type):
3365         (KJS::Bindings::CMethod::CMethod):
3366         (KJS::Bindings::CMethod::name):
3367         (KJS::Bindings::CMethod::numParameters):
3368         * bindings/c/c_utility.cpp: Added.
3369         (coerceValueToNPValueType):
3370         (convertValueToNPValueType):
3371         (convertNPValueTypeToValue):
3372         * bindings/c/c_utility.h: Added.
3373         * bindings/make_testbindings:
3374         * bindings/runtime.cpp:
3375         (Instance::createBindingForLanguageInstance):
3376         * bindings/runtime.h:
3377         (KJS::Bindings::Instance::):
3378         * bindings/testbindings.cpp: Added.
3379         (initializeIdentifiers):
3380         (myInterfaceHasProperty):
3381         (myInterfaceHasMethod):
3382         (myInterfaceGetProperty):
3383         (myInterfaceSetProperty):
3384         (myInterfaceInvoke):
3385         (myInterfaceAllocate):
3386         (myInterfaceInvalidate):
3387         (myInterfaceDeallocate):
3388         (GlobalImp::className):
3389         (readJavaScriptFromFile):
3390         (main):
3391
3392 2004-03-10  Richard Williamson   <rjw@apple.com>
3393
3394         Made changes to support new asychronous approach to calls from
3395         plugin to JavaScript
3396
3397         Reviewed by Chris.
3398
3399         * bindings/NP_jsobject.cpp:
3400         (NP_Call):
3401         (NP_Evaluate):
3402         (NP_GetProperty):
3403         (NP_ToString):
3404         (NP_GetPropertyAtIndex):
3405         * bindings/NP_runtime.h:
3406         * bindings/make_testbindings:
3407         * bindings/runtime.cpp:
3408         (Instance::createBindingForLanguageInstance):
3409
3410 2004-03-10  Richard Williamson   <rjw@apple.com>
3411
3412         Updated header to include proposed changes from
3413         plugin-futures list.  Calls from plugin to JavaScript
3414         are now asynchronous.
3415
3416         Reviewed by Chris.
3417
3418         * bindings/NP_runtime.h:
3419
3420 === Safari-131 ===
3421
3422 2004-03-04  Richard Williamson   <rjw@apple.com>
3423
3424         Implementation of NP_JavaScriptObject.  This is the 'C' class
3425         that wraps a JavaScript object.
3426
3427         Reviewed by Chris.
3428
3429         * JavaScriptCore.pbproj/project.pbxproj:
3430         * bindings/NP_jsobject.cpp: Added.
3431         (coerceValueToNPValueType):
3432         (convertValueToNPValueType):
3433         (convertNPValueTypeToValue):
3434         (listFromNPArray):
3435         (jsAllocate):
3436         (jsDeallocate):
3437         (identiferFromNPIdentifier):
3438         (NP_Call):
3439         (NP_Evaluate):
3440         (NP_GetProperty):
3441         (NP_SetProperty):
3442         (NP_RemoveProperty):
3443         (NP_ToString):
3444         (NP_GetPropertyAtIndex):
3445         (NP_SetPropertyAtIndex):
3446         * bindings/NP_runtime.cpp:
3447         (NP_ObjectAtIndex):
3448         * bindings/NP_runtime.h:
3449         * bindings/runtime_object.h:
3450
3451 2004-03-04  Richard Williamson   <rjw@apple.com>
3452
3453         Added NP_Array implementation.  
3454
3455         Changed NP_Boolean to just depend on two static instances, no
3456         space is required for values.
3457
3458         Reviewed by Chris.
3459
3460         * bindings/NP_runtime.cpp:
3461         (NP_CreateBoolean):
3462         (NP_BoolFromBoolean):
3463         (arrayAllocate):
3464         (arrayDeallocate):
3465         (NP_CreateArray):
3466         (NP_CreateArrayV):
3467         (NP_ObjectAtIndex):
3468         * bindings/NP_runtime.h:
3469
3470 2004-03-03  Darin Adler  <darin@apple.com>
3471
3472         Reviewed by Vicki.
3473
3474         * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3475         copyright string, and that's all that was in here.
3476         * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3477
3478 2004-03-03  Richard Williamson   <rjw@apple.com>
3479
3480         More 'C' binding implementation.  Fleshed out all the
3481         'primitive' data types.
3482
3483         Reviewed by Chris.
3484
3485         * bindings/NP_runtime.cpp:
3486         (NP_ReleaseObject):
3487         (numberAllocate):
3488         (stringAllocate):
3489         (stringDeallocate):
3490         (NP_CreateStringWithUTF8):
3491         (NP_CreateStringWithUTF16):
3492         (NP_UTF8FromString):
3493         (NP_UTF16FromString):
3494         (NP_StringLength):
3495         (booleanAllocate):
3496         (booleanDeallocate):
3497         (NP_CreateBoolean):
3498         (NP_BoolFromBoolean):
3499         (nullAllocate):
3500         (nullDeallocate):
3501         (NP_GetNull):
3502         (undefinedAllocate):
3503         (undefinedDeallocate):
3504         (NP_GetUndefined):
3505         * bindings/NP_runtime.h:
3506
3507 2004-03-03  Richard Williamson   <rjw@apple.com>
3508
3509         More 'C' binding implementation.
3510
3511         Reviewed by Chris.
3512
3513         * bindings/NP_runtime.cpp:
3514         (identifierEqual):
3515         (identifierHash):
3516         (getIdentifierDictionary):
3517         (NP_IdentifierFromUTF8):
3518         (NP_UTF8FromIdentifier):
3519         (NP_CreateObject):
3520         (NP_ReleaseObject):
3521         (NP_IsKindOfClass):
3522         (numberCreate):
3523         (NP_CreateNumberWithInt):
3524         (NP_CreateNumberWithFloat):
3525         (NP_CreateNumberWithDouble):
3526         (NP_IntFromNumber):
3527         (NP_FloatFromNumber):
3528         (NP_DoubleFromNumber):
3529         * bindings/NP_runtime.h:
3530
3531 2004-03-02  Richard Williamson   <rjw@apple.com>
3532
3533         Removed retain/release from NP_Class.  Classes will not be allowed to implement their
3534         own customer retain/release scheme.
3535
3536         Reviewed by Chris.
3537
3538         * bindings/NP_runtime.cpp:
3539         (NP_RetainObject):
3540         (NP_ReleaseObject):
3541         * bindings/NP_runtime.h:
3542
3543 2004-03-02  Richard Williamson   <rjw@apple.com>
3544
3545         C binding API.  Partial implementation.
3546
3547         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.
3548
3549         Factored root object reference counting scheme.  It is now useful independent
3550         of LiveConnect.
3551
3552         Reviewed by Chris.
35