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