Oolite
Loading...
Searching...
No Matches
NSNumber(OOJavaScriptConversion) Category Reference

Instance Methods

(jsval) - oo_jsValueInContext: [implementation]
(NSString *) - oo_jsClassName [implementation]

Detailed Description

Definition at line 1766 of file OOJavaScriptEngine.m.

Method Documentation

◆ oo_jsClassName

- (NSString *) oo_jsClassName
implementation

Definition at line 1797 of file OOJavaScriptEngine.m.

1798{
1799 return @"Number";
1800}

References oo_jsClassName.

Referenced by oo_jsClassName.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ oo_jsValueInContext:

- (JSValue) oo_jsValueInContext: (JSContext*) context
implementation

Definition at line 1768 of file OOJavaScriptEngine.m.

1768 :(JSContext*)context
1769{
1771
1772 jsval result;
1773 BOOL isFloat = NO;
1774 long long longLongValue;
1775
1776 isFloat = [self oo_isFloatingPointNumber];
1777 if (!isFloat) {
1778 longLongValue = [self longLongValue];
1779 if (longLongValue < (long long)JSVAL_INT_MIN || (long long)JSVAL_INT_MAX < longLongValue) {
1780 // values outside JSVAL_INT range are returned as doubles.
1781 isFloat = YES;
1782 }
1783 }
1784
1785 if (isFloat) {
1786 if (!JS_NewNumberValue(context, [self doubleValue], &result))
1787 result = JSVAL_VOID;
1788 } else {
1789 result = INT_TO_JSVAL((int32_t)longLongValue);
1790 }
1791
1792 return result;
1793
1795}
#define OOJS_PROFILE_ENTER
#define OOJS_PROFILE_EXIT_JSVAL

References OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT_JSVAL.


The documentation for this category was generated from the following files: