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