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