Changeset 43160 in webkit for trunk/JavaScriptCore/API/APICast.h
- Timestamp:
- May 3, 2009, 2:02:04 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/APICast.h
r43158 r43160 27 27 #define APICast_h 28 28 29 #include "JSNumberCell.h" 29 30 #include "JSValue.h" 31 #include <wtf/Platform.h> 30 32 31 33 namespace JSC { … … 56 58 } 57 59 58 inline JSC::JSValue toJS(JS ValueRef v)60 inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) 59 61 { 60 return JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 62 JSC::JSValue jsValue = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 63 #if !USE(ALTERNATE_JSIMMEDIATE) 64 if (jsValue && jsValue.isNumber()) { 65 ASSERT(jsValue.isAPIMangledNumber()); 66 return JSC::jsNumber(exec, jsValue.uncheckedGetNumber()); 67 } 68 #endif 69 return jsValue; 61 70 } 62 71 … … 76 85 } 77 86 78 inline JSValueRef toRef(JSC:: JSValue v)87 inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v) 79 88 { 89 #if !USE(ALTERNATE_JSIMMEDIATE) 90 if (v && v.isNumber()) { 91 ASSERT(!v.isAPIMangledNumber()); 92 return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(JSC::jsAPIMangledNumber(exec, v.uncheckedGetNumber()))); 93 } 94 #endif 80 95 return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v)); 81 }82 83 inline JSValueRef* toRef(JSC::JSValue* v)84 {85 return reinterpret_cast<JSValueRef*>(v);86 96 } 87 97
Note:
See TracChangeset
for help on using the changeset viewer.