Commit 6c3268ce authored by mjs@apple.com's avatar mjs@apple.com

JavaScriptCore:

2008-10-06  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed. Build fix.
        
        - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these

        * API/JSValueRef.cpp:
        (JSValueToBoolean):
        * ChangeLog:
        * JavaScriptCore.exp:
        * VM/CodeBlock.cpp:
        (JSC::CodeBlock::dump):
        * VM/Machine.cpp:
        (JSC::Machine::privateExecute):
        (JSC::Machine::cti_op_loop_if_true):
        (JSC::Machine::cti_op_not):
        (JSC::Machine::cti_op_jtrue):
        * kjs/ArrayPrototype.cpp:
        (JSC::arrayProtoFuncFilter):
        (JSC::arrayProtoFuncEvery):
        (JSC::arrayProtoFuncSome):
        * kjs/BooleanConstructor.cpp:
        (JSC::constructBoolean):
        (JSC::callBooleanConstructor):
        * kjs/GetterSetter.h:
        * kjs/JSCell.h:
        (JSC::JSValue::toBoolean):
        * kjs/JSNumberCell.cpp:
        (JSC::JSNumberCell::toBoolean):
        * kjs/JSNumberCell.h:
        * kjs/JSObject.cpp:
        (JSC::JSObject::toBoolean):
        * kjs/JSObject.h:
        * kjs/JSString.cpp:
        (JSC::JSString::toBoolean):
        * kjs/JSString.h:
        * kjs/JSValue.h:
        * kjs/RegExpConstructor.cpp:
        (JSC::setRegExpConstructorMultiline):
        * kjs/RegExpObject.cpp:
        (JSC::RegExpObject::match):
        * kjs/RegExpPrototype.cpp:
        (JSC::regExpProtoFuncToString):

JavaScriptGlue:

2008-10-06  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed. Build fix.

        - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these

        * JSUtils.cpp:
        (KJSValueToCFTypeInternal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d11bb12b
...@@ -188,9 +188,11 @@ JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string) ...@@ -188,9 +188,11 @@ JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string)
return toRef(jsString(exec, string->ustring())); return toRef(jsString(exec, string->ustring()));
} }
bool JSValueToBoolean(JSContextRef, JSValueRef value) bool JSValueToBoolean(JSContextRef ctx, JSValueRef value)
{ {
return toJS(value)->toBoolean(); ExecState* exec = toJS(ctx);
JSValue* jsValue = toJS(value);
return jsValue->toBoolean(exec);
} }
double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception) double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception)
......
2008-10-06 Maciej Stachowiak <mjs@apple.com>
Not reviewed. Build fix.
- revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
* API/JSValueRef.cpp:
(JSValueToBoolean):
* ChangeLog:
* JavaScriptCore.exp:
* VM/CodeBlock.cpp:
(JSC::CodeBlock::dump):
* VM/Machine.cpp:
(JSC::Machine::privateExecute):
(JSC::Machine::cti_op_loop_if_true):
(JSC::Machine::cti_op_not):
(JSC::Machine::cti_op_jtrue):
* kjs/ArrayPrototype.cpp:
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncSome):
* kjs/BooleanConstructor.cpp:
(JSC::constructBoolean):
(JSC::callBooleanConstructor):
* kjs/GetterSetter.h:
* kjs/JSCell.h:
(JSC::JSValue::toBoolean):
* kjs/JSNumberCell.cpp:
(JSC::JSNumberCell::toBoolean):
* kjs/JSNumberCell.h:
* kjs/JSObject.cpp:
(JSC::JSObject::toBoolean):
* kjs/JSObject.h:
* kjs/JSString.cpp:
(JSC::JSString::toBoolean):
* kjs/JSString.h:
* kjs/JSValue.h:
* kjs/RegExpConstructor.cpp:
(JSC::setRegExpConstructorMultiline):
* kjs/RegExpObject.cpp:
(JSC::RegExpObject::match):
* kjs/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
2008-10-06 Maciej Stachowiak <mjs@apple.com> 2008-10-06 Maciej Stachowiak <mjs@apple.com>
Reviewed by Sam Weinig. Reviewed by Sam Weinig.
......
...@@ -335,6 +335,7 @@ __ZNK3JSC8JSObject8toNumberEPNS_9ExecStateE ...@@ -335,6 +335,7 @@ __ZNK3JSC8JSObject8toNumberEPNS_9ExecStateE
__ZNK3JSC8JSObject8toObjectEPNS_9ExecStateE __ZNK3JSC8JSObject8toObjectEPNS_9ExecStateE
__ZNK3JSC8JSObject8toStringEPNS_9ExecStateE __ZNK3JSC8JSObject8toStringEPNS_9ExecStateE
__ZNK3JSC8JSObject9classNameEv __ZNK3JSC8JSObject9classNameEv
__ZNK3JSC8JSObject9toBooleanEPNS_9ExecStateE
__ZNK3JSC9CodeBlock17derefStructureIDsEPNS_11InstructionE __ZNK3JSC9CodeBlock17derefStructureIDsEPNS_11InstructionE
__ZNK3JSC9HashTable11createTableEPNS_12JSGlobalDataE __ZNK3JSC9HashTable11createTableEPNS_12JSGlobalDataE
__ZNK3WTF8Collator7collateEPKtmS2_m __ZNK3WTF8Collator7collateEPKtmS2_m
......
...@@ -810,11 +810,13 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator& ...@@ -810,11 +810,13 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
break; break;
} }
case op_tear_off_activation: { case op_tear_off_activation: {
printf("[%4d] tear_off_activation\n", location); int r0 = (++it)->u.operand;
printf("[%4d] tear_off_activation\t %s\n", location, registerName(r0).c_str());
break; break;
} }
case op_tear_off_arguments: { case op_tear_off_arguments: {
printf("[%4d] tear_off_arguments\n", location); int r0 = (++it)->u.operand;
printf("[%4d] tear_off_arguments\t %s\n", location, registerName(r0).c_str());
break; break;
} }
case op_ret: { case op_ret: {
......
...@@ -2127,7 +2127,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, ...@@ -2127,7 +2127,8 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
*/ */
int dst = (++vPC)->u.operand; int dst = (++vPC)->u.operand;
int src = (++vPC)->u.operand; int src = (++vPC)->u.operand;
JSValue* result = jsBoolean(!r[src].jsValue(exec)->toBoolean()); JSValue* result = jsBoolean(!r[src].jsValue(exec)->toBoolean(exec));
VM_CHECK_EXCEPTION();
r[dst] = result; r[dst] = result;
++vPC; ++vPC;
...@@ -2985,7 +2986,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, ...@@ -2985,7 +2986,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
*/ */
int cond = (++vPC)->u.operand; int cond = (++vPC)->u.operand;
int target = (++vPC)->u.operand; int target = (++vPC)->u.operand;
if (r[cond].jsValue(exec)->toBoolean()) { if (r[cond].jsValue(exec)->toBoolean(exec)) {
vPC += target; vPC += target;
CHECK_FOR_TIMEOUT(); CHECK_FOR_TIMEOUT();
NEXT_OPCODE; NEXT_OPCODE;
...@@ -3002,7 +3003,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, ...@@ -3002,7 +3003,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
*/ */
int cond = (++vPC)->u.operand; int cond = (++vPC)->u.operand;
int target = (++vPC)->u.operand; int target = (++vPC)->u.operand;
if (r[cond].jsValue(exec)->toBoolean()) { if (r[cond].jsValue(exec)->toBoolean(exec)) {
vPC += target; vPC += target;
NEXT_OPCODE; NEXT_OPCODE;
} }
...@@ -3018,7 +3019,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, ...@@ -3018,7 +3019,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile,
*/ */
int cond = (++vPC)->u.operand; int cond = (++vPC)->u.operand;
int target = (++vPC)->u.operand; int target = (++vPC)->u.operand;
if (!r[cond].jsValue(exec)->toBoolean()) { if (!r[cond].jsValue(exec)->toBoolean(exec)) {
vPC += target; vPC += target;
NEXT_OPCODE; NEXT_OPCODE;
} }
...@@ -4987,7 +4988,11 @@ int Machine::cti_op_loop_if_true(CTI_ARGS) ...@@ -4987,7 +4988,11 @@ int Machine::cti_op_loop_if_true(CTI_ARGS)
{ {
JSValue* src1 = ARG_src1; JSValue* src1 = ARG_src1;
return src1->toBoolean(); ExecState* exec = ARG_exec;
bool result = src1->toBoolean(exec);
VM_CHECK_EXCEPTION_AT_END();
return result;
} }
JSValue* Machine::cti_op_negate(CTI_ARGS) JSValue* Machine::cti_op_negate(CTI_ARGS)
...@@ -5110,12 +5115,24 @@ int Machine::cti_op_jless(CTI_ARGS) ...@@ -5110,12 +5115,24 @@ int Machine::cti_op_jless(CTI_ARGS)
JSValue* Machine::cti_op_not(CTI_ARGS) JSValue* Machine::cti_op_not(CTI_ARGS)
{ {
return jsBoolean(!ARG_src1->toBoolean()); JSValue* src = ARG_src1;
ExecState* exec = ARG_exec;
JSValue* result = jsBoolean(!src->toBoolean(exec));
VM_CHECK_EXCEPTION_AT_END();
return result;
} }
int SFX_CALL Machine::cti_op_jtrue(CTI_ARGS) int SFX_CALL Machine::cti_op_jtrue(CTI_ARGS)
{ {
return ARG_src1->toBoolean(); JSValue* src1 = ARG_src1;
ExecState* exec = ARG_exec;
bool result = src1->toBoolean(exec);
VM_CHECK_EXCEPTION_AT_END();
return result;
} }
JSValue* Machine::cti_op_post_inc(CTI_ARGS) JSValue* Machine::cti_op_post_inc(CTI_ARGS)
......
...@@ -582,7 +582,7 @@ JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject*, JSValue* thisValue, co ...@@ -582,7 +582,7 @@ JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject*, JSValue* thisValue, co
JSValue* result = call(exec, function, callType, callData, applyThis, eachArguments); JSValue* result = call(exec, function, callType, callData, applyThis, eachArguments);
if (result->toBoolean()) if (result->toBoolean(exec))
resultArray->put(exec, filterIndex++, v); resultArray->put(exec, filterIndex++, v);
} }
return resultArray; return resultArray;
...@@ -656,7 +656,7 @@ JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject*, JSValue* thisValue, con ...@@ -656,7 +656,7 @@ JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject*, JSValue* thisValue, con
eachArguments.append(jsNumber(exec, k)); eachArguments.append(jsNumber(exec, k));
eachArguments.append(thisObj); eachArguments.append(thisObj);
bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments)->toBoolean(); bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments)->toBoolean(exec);
if (!predicateResult) { if (!predicateResult) {
result = jsBoolean(false); result = jsBoolean(false);
...@@ -720,7 +720,7 @@ JSValue* arrayProtoFuncSome(ExecState* exec, JSObject*, JSValue* thisValue, cons ...@@ -720,7 +720,7 @@ JSValue* arrayProtoFuncSome(ExecState* exec, JSObject*, JSValue* thisValue, cons
eachArguments.append(jsNumber(exec, k)); eachArguments.append(jsNumber(exec, k));
eachArguments.append(thisObj); eachArguments.append(thisObj);
bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments)->toBoolean(); bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments)->toBoolean(exec);
if (predicateResult) { if (predicateResult) {
result = jsBoolean(true); result = jsBoolean(true);
......
...@@ -41,7 +41,7 @@ BooleanConstructor::BooleanConstructor(ExecState* exec, PassRefPtr<StructureID> ...@@ -41,7 +41,7 @@ BooleanConstructor::BooleanConstructor(ExecState* exec, PassRefPtr<StructureID>
JSObject* constructBoolean(ExecState* exec, const ArgList& args) JSObject* constructBoolean(ExecState* exec, const ArgList& args)
{ {
BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure()); BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure());
obj->setInternalValue(jsBoolean(args.at(exec, 0)->toBoolean())); obj->setInternalValue(jsBoolean(args.at(exec, 0)->toBoolean(exec)));
return obj; return obj;
} }
...@@ -59,7 +59,7 @@ ConstructType BooleanConstructor::getConstructData(ConstructData& constructData) ...@@ -59,7 +59,7 @@ ConstructType BooleanConstructor::getConstructData(ConstructData& constructData)
// ECMA 15.6.1 // ECMA 15.6.1
static JSValue* callBooleanConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args) static JSValue* callBooleanConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
{ {
return jsBoolean(args.at(exec, 0)->toBoolean()); return jsBoolean(args.at(exec, 0)->toBoolean(exec));
} }
CallType BooleanConstructor::getCallData(CallData& callData) CallType BooleanConstructor::getCallData(CallData& callData)
......
...@@ -52,7 +52,7 @@ namespace JSC { ...@@ -52,7 +52,7 @@ namespace JSC {
virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const; virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const;
virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value); virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value);
bool toBoolean(ExecState*) const; virtual bool toBoolean(ExecState*) const;
virtual double toNumber(ExecState*) const; virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const; virtual UString toString(ExecState*) const;
virtual JSObject* toObject(ExecState*) const; virtual JSObject* toObject(ExecState*) const;
......
...@@ -72,7 +72,7 @@ namespace JSC { ...@@ -72,7 +72,7 @@ namespace JSC {
// Basic conversions. // Basic conversions.
virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const = 0; virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const = 0;
virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*&) = 0; virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*&) = 0;
bool toBoolean() const; virtual bool toBoolean(ExecState*) const = 0;
virtual double toNumber(ExecState*) const = 0; virtual double toNumber(ExecState*) const = 0;
virtual UString toString(ExecState*) const = 0; virtual UString toString(ExecState*) const = 0;
virtual JSObject* toObject(ExecState*) const = 0; virtual JSObject* toObject(ExecState*) const = 0;
...@@ -272,9 +272,9 @@ namespace JSC { ...@@ -272,9 +272,9 @@ namespace JSC {
return asCell()->getPrimitiveNumber(exec, number, value); return asCell()->getPrimitiveNumber(exec, number, value);
} }
inline bool JSValue::toBoolean() const inline bool JSValue::toBoolean(ExecState* exec) const
{ {
return JSImmediate::isImmediate(this) ? JSImmediate::toBoolean(this) : asCell()->toBoolean(); return JSImmediate::isImmediate(this) ? JSImmediate::toBoolean(this) : asCell()->toBoolean(exec);
} }
ALWAYS_INLINE double JSValue::toNumber(ExecState* exec) const ALWAYS_INLINE double JSValue::toNumber(ExecState* exec) const
......
...@@ -40,6 +40,11 @@ bool JSNumberCell::getPrimitiveNumber(ExecState*, double& number, JSValue*& valu ...@@ -40,6 +40,11 @@ bool JSNumberCell::getPrimitiveNumber(ExecState*, double& number, JSValue*& valu
return true; return true;
} }
bool JSNumberCell::toBoolean(ExecState*) const
{
return m_value < 0.0 || m_value > 0.0; // false for NaN
}
double JSNumberCell::toNumber(ExecState*) const double JSNumberCell::toNumber(ExecState*) const
{ {
return m_value; return m_value;
......
...@@ -52,7 +52,7 @@ namespace JSC { ...@@ -52,7 +52,7 @@ namespace JSC {
virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const; virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const;
virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value); virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value);
bool toBoolean() const { return m_value < 0.0 || m_value > 0.0; /* false for NaN */ } virtual bool toBoolean(ExecState*) const;
virtual double toNumber(ExecState*) const; virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const; virtual UString toString(ExecState*) const;
virtual JSObject* toObject(ExecState*) const; virtual JSObject* toObject(ExecState*) const;
......
...@@ -430,6 +430,11 @@ void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyName ...@@ -430,6 +430,11 @@ void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyName
m_structureID->getEnumerablePropertyNames(exec, propertyNames, this); m_structureID->getEnumerablePropertyNames(exec, propertyNames, this);
} }
bool JSObject::toBoolean(ExecState*) const
{
return true;
}
double JSObject::toNumber(ExecState* exec) const double JSObject::toNumber(ExecState* exec) const
{ {
JSValue* primitive = toPrimitive(exec, PreferNumber); JSValue* primitive = toPrimitive(exec, PreferNumber);
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "CommonIdentifiers.h" #include "CommonIdentifiers.h"
#include "ExecState.h" #include "ExecState.h"
#include "JSNumberCell.h" #include "JSNumberCell.h"
#include "JSString.h"
#include "PropertyMap.h" #include "PropertyMap.h"
#include "PropertySlot.h" #include "PropertySlot.h"
#include "PutPropertySlot.h" #include "PutPropertySlot.h"
...@@ -110,7 +109,7 @@ namespace JSC { ...@@ -110,7 +109,7 @@ namespace JSC {
virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const; virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const;
virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value); virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value);
bool toBoolean() const { return true; } virtual bool toBoolean(ExecState*) const;
virtual double toNumber(ExecState*) const; virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const; virtual UString toString(ExecState*) const;
virtual JSObject* toObject(ExecState*) const; virtual JSObject* toObject(ExecState*) const;
...@@ -247,17 +246,6 @@ inline bool JSCell::isObject(const ClassInfo* info) const ...@@ -247,17 +246,6 @@ inline bool JSCell::isObject(const ClassInfo* info) const
return false; return false;
} }
inline bool JSCell::toBoolean() const
{
JSType type = structureID()->typeInfo().type();
if (type == NumberType)
return static_cast<const JSNumberCell*>(this)->toBoolean();
if (type == ObjectType)
return static_cast<const JSObject*>(this)->toBoolean();
ASSERT(type == StringType);
return static_cast<const JSString*>(this)->toBoolean();
}
// this method is here to be after the inline declaration of JSCell::isObject // this method is here to be after the inline declaration of JSCell::isObject
inline bool JSValue::isObject(const ClassInfo* classInfo) const inline bool JSValue::isObject(const ClassInfo* classInfo) const
{ {
......
...@@ -42,6 +42,11 @@ bool JSString::getPrimitiveNumber(ExecState*, double& number, JSValue*& value) ...@@ -42,6 +42,11 @@ bool JSString::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
return false; return false;
} }
bool JSString::toBoolean(ExecState*) const
{
return !m_value.isEmpty();
}
double JSString::toNumber(ExecState*) const double JSString::toNumber(ExecState*) const
{ {
return m_value.toDouble(); return m_value.toDouble();
......
...@@ -92,8 +92,6 @@ namespace JSC { ...@@ -92,8 +92,6 @@ namespace JSC {
static PassRefPtr<StructureID> createStructureID(JSValue* proto) { return StructureID::create(proto, TypeInfo(StringType, NeedsThisConversion)); } static PassRefPtr<StructureID> createStructureID(JSValue* proto) { return StructureID::create(proto, TypeInfo(StringType, NeedsThisConversion)); }
bool toBoolean() const { return !m_value.isEmpty(); }
private: private:
enum VPtrStealingHackType { VPtrStealingHack }; enum VPtrStealingHackType { VPtrStealingHack };
JSString(VPtrStealingHackType) JSString(VPtrStealingHackType)
...@@ -103,6 +101,7 @@ namespace JSC { ...@@ -103,6 +101,7 @@ namespace JSC {
virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const; virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const;
virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value); virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue*& value);
virtual bool toBoolean(ExecState*) const;
virtual double toNumber(ExecState*) const; virtual double toNumber(ExecState*) const;
virtual JSObject* toObject(ExecState*) const; virtual JSObject* toObject(ExecState*) const;
virtual UString toString(ExecState*) const; virtual UString toString(ExecState*) const;
......
...@@ -96,7 +96,7 @@ namespace JSC { ...@@ -96,7 +96,7 @@ namespace JSC {
JSValue* toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const; JSValue* toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const;
bool getPrimitiveNumber(ExecState*, double& number, JSValue*&); bool getPrimitiveNumber(ExecState*, double& number, JSValue*&);
bool toBoolean() const; bool toBoolean(ExecState*) const;
// toNumber conversion is expected to be side effect free if an exception has // toNumber conversion is expected to be side effect free if an exception has
// been set in the ExecState already. // been set in the ExecState already.
......
...@@ -311,9 +311,9 @@ void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue* v ...@@ -311,9 +311,9 @@ void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue* v
static_cast<RegExpConstructor*>(baseObject)->setInput(value->toString(exec)); static_cast<RegExpConstructor*>(baseObject)->setInput(value->toString(exec));
} }
void setRegExpConstructorMultiline(ExecState*, JSObject* baseObject, JSValue* value) void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValue* value)
{ {
static_cast<RegExpConstructor*>(baseObject)->setMultiline(value->toBoolean()); static_cast<RegExpConstructor*>(baseObject)->setMultiline(value->toBoolean(exec));
} }
// ECMA 15.10.4 // ECMA 15.10.4
......
...@@ -121,7 +121,7 @@ bool RegExpObject::match(ExecState* exec, const ArgList& args) ...@@ -121,7 +121,7 @@ bool RegExpObject::match(ExecState* exec, const ArgList& args)
} }
} }
bool global = get(exec, exec->propertyNames().global)->toBoolean(); bool global = get(exec, exec->propertyNames().global)->toBoolean(exec);
int lastIndex = 0; int lastIndex = 0;
if (global) { if (global) {
if (d->lastIndex < 0 || d->lastIndex > input.size()) { if (d->lastIndex < 0 || d->lastIndex > input.size()) {
......
...@@ -106,11 +106,11 @@ JSValue* regExpProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, ...@@ -106,11 +106,11 @@ JSValue* regExpProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue,
UString result = "/" + static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().source)->toString(exec); UString result = "/" + static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().source)->toString(exec);
result.append('/'); result.append('/');
if (static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().global)->toBoolean()) if (static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().global)->toBoolean(exec))
result.append('g'); result.append('g');
if (static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().ignoreCase)->toBoolean()) if (static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().ignoreCase)->toBoolean(exec))
result.append('i'); result.append('i');
if (static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().multiline)->toBoolean()) if (static_cast<RegExpObject*>(thisValue)->get(exec, exec->propertyNames().multiline)->toBoolean(exec))
result.append('m'); result.append('m');
return jsNontrivialString(exec, result); return jsNontrivialString(exec, result);
} }
......
2008-10-06 Maciej Stachowiak <mjs@apple.com>
Not reviewed. Build fix.
- revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
* JSUtils.cpp:
(KJSValueToCFTypeInternal):
2008-10-06 Maciej Stachowiak <mjs@apple.com> 2008-10-06 Maciej Stachowiak <mjs@apple.com>
Not reviewed. Not reviewed.
......
...@@ -207,7 +207,7 @@ CFTypeRef KJSValueToCFTypeInternal(JSValue *inValue, ExecState *exec, ObjectImpL ...@@ -207,7 +207,7 @@ CFTypeRef KJSValueToCFTypeInternal(JSValue *inValue, ExecState *exec, ObjectImpL
if (inValue->isBoolean()) if (inValue->isBoolean())
{ {
result = inValue->toBoolean() ? kCFBooleanTrue : kCFBooleanFalse; result = inValue->toBoolean(exec) ? kCFBooleanTrue : kCFBooleanFalse;
RetainCFType(result); RetainCFType(result);
return result; return result;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment