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