Changeset 43138 in webkit for trunk/JavaScriptCore/API/APICast.h
- Timestamp:
- May 1, 2009, 9:52:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/APICast.h
r43130 r43138 27 27 #define APICast_h 28 28 29 #include "JSNumberCell.h"30 29 #include "JSValue.h" 31 #include <wtf/Platform.h>32 30 33 31 namespace JSC { … … 58 56 } 59 57 60 inline JSC::JSValue toJS(JS C::ExecState* exec, JSValueRef v)58 inline JSC::JSValue toJS(JSValueRef v) 61 59 { 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; 60 return JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v))); 70 61 } 71 62 … … 85 76 } 86 77 87 inline JSValueRef toRef(JSC:: ExecState* exec, JSC::JSValue v)78 inline JSValueRef toRef(JSC::JSValue v) 88 79 { 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 #endif95 80 return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v)); 81 } 82 83 inline JSValueRef* toRef(JSC::JSValue* v) 84 { 85 return reinterpret_cast<JSValueRef*>(v); 96 86 } 97 87
Note:
See TracChangeset
for help on using the changeset viewer.