Oolite 1.91.0.7644-241112-7f5034b
|
#include <jsdbgapi.h>
import "OOJavaScriptEngine.h"
import "OOJSEngineTimeManagement.h"
import "OOJSScript.h"
import "OOCollectionExtractors.h"
import "Universe.h"
import "OOPlanetEntity.h"
import "NSStringOOExtensions.h"
import "OOWeakReference.h"
import "EntityOOJavaScriptExtensions.h"
import "ResourceManager.h"
import "NSNumberOOExtensions.h"
import "OOConstToJSString.h"
import "OOVisualEffectEntity.h"
import "OOWaypointEntity.h"
import "OOJSGlobal.h"
import "OOJSMissionVariables.h"
import "OOJSMission.h"
import "OOJSVector.h"
import "OOJSQuaternion.h"
import "OOJSEntity.h"
import "OOJSShip.h"
import "OOJSStation.h"
import "OOJSDock.h"
import "OOJSVisualEffect.h"
import "OOJSExhaustPlume.h"
import "OOJSFlasher.h"
import "OOJSWormhole.h"
import "OOJSWaypoint.h"
import "OOJSPlayer.h"
import "OOJSPlayerShip.h"
import "OOJSManifest.h"
import "OOJSPlanet.h"
import "OOJSSystem.h"
import "OOJSOolite.h"
import "OOJSTimer.h"
import "OOJSClock.h"
import "OOJSSun.h"
import "OOJSWorldScripts.h"
import "OOJSSound.h"
import "OOJSSoundSource.h"
import "OOJSSpecialFunctions.h"
import "OOJSSystemInfo.h"
import "OOJSEquipmentInfo.h"
import "OOJSShipGroup.h"
import "OOJSFrameCallbacks.h"
import "OOJSFont.h"
import "OOProfilingStopwatch.h"
import "OOLoggingExtended.h"
#include <stdlib.h>
Go to the source code of this file.
Classes | |
category | OOJavaScriptEngine(OOMonitorSupportInternal) |
category | OOJavaScriptEngine(Private) |
Macros | |
#define | OOJSENGINE_JSVERSION JSVERSION_ECMA_5 |
#define | JIT_OPTIONS JSOPTION_JIT | JSOPTION_METHODJIT | JSOPTION_PROFILING |
#define | OOJSENGINE_CONTEXT_OPTIONS JSOPTION_VAROBJFIX | JSOPTION_RELIMIT | JSOPTION_ANONFUNFIX | JIT_OPTIONS |
#define | OOJS_STACK_SIZE 8192 |
#define | OOJS_RUNTIME_SIZE_MiB 32 |
Functions | |
static void | ReportJSError (JSContext *context, const char *message, JSErrorReport *report) |
static id | JSArrayConverter (JSContext *context, JSObject *object) |
static id | JSStringConverter (JSContext *context, JSObject *object) |
static id | JSNumberConverter (JSContext *context, JSObject *object) |
static id | JSBooleanConverter (JSContext *context, JSObject *object) |
static void | UnregisterObjectConverters (void) |
static void | UnregisterSubclasses (void) |
static void | DumpVariable (JSContext *context, JSPropertyDesc *prop) |
void | OOJSDumpStack (JSContext *context) |
static void | GetLocationNameAndLine (JSContext *context, JSStackFrame *stackFrame, const char **name, NSUInteger *line) |
NSString * | OOJSDescribeLocation (JSContext *context, JSStackFrame *stackFrame) |
void | OOJSMarkConsoleEvalLocation (JSContext *context, JSStackFrame *stackFrame) |
void | OOJSInitJSIDCachePRIVATE (const char *name, jsid *idCache) |
jsid | OOJSIDFromString (NSString *string) |
NSString * | OOStringFromJSID (jsid propID) |
static NSString * | CallerPrefix (NSString *scriptClass, NSString *function) |
void | OOJSReportError (JSContext *context, NSString *format,...) |
void | OOJSReportErrorForCaller (JSContext *context, NSString *scriptClass, NSString *function, NSString *format,...) |
void | OOJSReportErrorWithArguments (JSContext *context, NSString *format, va_list args) |
void | OOJSReportWrappedException (JSContext *context, id exception) |
void | OOJSUnreachable (const char *function, const char *file, unsigned line) |
void | OOJSReportWarning (JSContext *context, NSString *format,...) |
void | OOJSReportWarningForCaller (JSContext *context, NSString *scriptClass, NSString *function, NSString *format,...) |
void | OOJSReportWarningWithArguments (JSContext *context, NSString *format, va_list args) |
void | OOJSReportBadPropertySelector (JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec) |
void | OOJSReportBadPropertyValue (JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec, jsval value) |
void | OOJSReportBadArguments (JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, NSString *message, NSString *expectedArgsDescription) |
void | OOJSSetWarningOrErrorStackSkip (unsigned skip) |
BOOL | OOJSArgumentListGetNumber (JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, double *outNumber, uintN *outConsumed) |
BOOL | OOJSArgumentListGetNumberNoError (JSContext *context, uintN argc, jsval *argv, double *outNumber, uintN *outConsumed) |
static JSObject * | JSArrayFromNSArray (JSContext *context, NSArray *array) |
static BOOL | JSNewNSArrayValue (JSContext *context, NSArray *array, jsval *value) |
static JSObject * | JSObjectFromNSDictionary (JSContext *context, NSDictionary *dictionary) |
static BOOL | JSNewNSDictionaryValue (JSContext *context, NSDictionary *dictionary, jsval *value) |
JSObject * | OOJSObjectFromNativeObject (JSContext *context, id object) |
void | OOJSStrLiteralCachePRIVATE (const char *string, jsval *strCache, BOOL *inited) |
NSString * | OOStringFromJSString (JSContext *context, JSString *string) |
NSString * | OOStringFromJSValueEvenIfNull (JSContext *context, jsval value) |
NSString * | OOStringFromJSValue (JSContext *context, jsval value) |
NSString * | OOStringFromJSPropertyIDAndSpec (JSContext *context, jsid propID, JSPropertySpec *propertySpec) |
static NSString * | DescribeValue (JSContext *context, jsval value, BOOL abbreviateObjects, BOOL recursing) |
NSString * | OOJSDescribeValue (JSContext *context, jsval value, BOOL abbreviateObjects) |
JSBool | OOJSUnconstructableConstruct (JSContext *context, uintN argc, jsval *vp) |
void | OOJSObjectWrapperFinalize (JSContext *context, JSObject *this) |
JSBool | OOJSObjectWrapperToString (JSContext *context, uintN argc, jsval *vp) |
BOOL | JSFunctionPredicate (Entity *entity, void *parameter) |
BOOL | JSEntityIsJavaScriptVisiblePredicate (Entity *entity, void *parameter) |
BOOL | JSEntityIsJavaScriptSearchablePredicate (Entity *entity, void *parameter) |
BOOL | JSEntityIsDemoShipPredicate (Entity *entity, void *parameter) |
void | OOJSRegisterSubclass (JSClass *subclass, JSClass *superclass) |
BOOL | OOJSIsSubclass (JSClass *putativeSubclass, JSClass *superclass) |
BOOL | OOJSObjectGetterImplPRIVATE (JSContext *context, JSObject *object, JSClass *requiredJSClass, Class requiredObjCClass, const char *name, id *outObject) |
NSDictionary * | OOJSDictionaryFromJSValue (JSContext *context, jsval value) |
NSDictionary * | OOJSDictionaryFromJSObject (JSContext *context, JSObject *object) |
NSDictionary * | OOJSDictionaryFromStringTable (JSContext *context, jsval tableValue) |
id | OOJSNativeObjectFromJSValue (JSContext *context, jsval value) |
id | OOJSNativeObjectFromJSObject (JSContext *context, JSObject *tableObject) |
id | OOJSNativeObjectOfClassFromJSValue (JSContext *context, jsval value, Class requiredClass) |
id | OOJSNativeObjectOfClassFromJSObject (JSContext *context, JSObject *object, Class requiredClass) |
id | OOJSBasicPrivateObjectConverter (JSContext *context, JSObject *object) |
void | OOJSRegisterObjectConverter (JSClass *theClass, OOJSClassConverterCallback converter) |
Variables | |
static OOJavaScriptEngine * | sSharedEngine = nil |
static unsigned | sErrorHandlerStackSkip = 0 |
JSContext * | gOOJSMainThreadContext = NULL |
NSString *const | kOOJavaScriptEngineWillResetNotification = @"org.aegidian.oolite OOJavaScriptEngine will reset" |
NSString *const | kOOJavaScriptEngineDidResetNotification = @"org.aegidian.oolite OOJavaScriptEngine did reset" |
static const char * | sConsoleScriptName |
static NSUInteger | sConsoleEvalLineNo |
static NSMapTable * | sRegisteredSubClasses |
static NSMutableDictionary * | sObjectConverters |
#define JIT_OPTIONS JSOPTION_JIT | JSOPTION_METHODJIT | JSOPTION_PROFILING |
Definition at line 85 of file OOJavaScriptEngine.m.
#define OOJS_RUNTIME_SIZE_MiB 32 |
Definition at line 91 of file OOJavaScriptEngine.m.
#define OOJS_STACK_SIZE 8192 |
Definition at line 90 of file OOJavaScriptEngine.m.
#define OOJSENGINE_CONTEXT_OPTIONS JSOPTION_VAROBJFIX | JSOPTION_RELIMIT | JSOPTION_ANONFUNFIX | JIT_OPTIONS |
Definition at line 87 of file OOJavaScriptEngine.m.
#define OOJSENGINE_JSVERSION JSVERSION_ECMA_5 |
Definition at line 81 of file OOJavaScriptEngine.m.
|
static |
Definition at line 992 of file OOJavaScriptEngine.m.
References nil.
Referenced by OOJSReportErrorForCaller(), and OOJSReportWarningForCaller().
|
static |
Definition at line 1634 of file OOJavaScriptEngine.m.
References count, DescribeValue(), JS_IsInRequest, MIN, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSGetClass(), OOJSValueIsFunction(), OOStringFromJSValueEvenIfNull(), and OOJavaScriptEngine::sharedEngine.
Referenced by DescribeValue(), and OOJSDescribeValue().
|
static |
Definition at line 711 of file OOJavaScriptEngine.m.
References OOJSDescribeValue(), OOLog, and OOStringFromJSValueEvenIfNull().
Referenced by OOJSDumpStack().
|
static |
Definition at line 870 of file OOJavaScriptEngine.m.
Referenced by OOJSDescribeLocation(), and OOJSMarkConsoleEvalLocation().
|
static |
Definition at line 2481 of file OOJavaScriptEngine.m.
References count, nil, and OOJSNativeObjectFromJSValue().
|
static |
Definition at line 1201 of file OOJavaScriptEngine.m.
References count, EXPECT_NOT, nil, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
Referenced by JSNewNSArrayValue().
|
static |
Definition at line 2531 of file OOJavaScriptEngine.m.
BOOL JSEntityIsDemoShipPredicate | ( | Entity * | entity, |
void * | parameter ) |
Definition at line 2134 of file OOJavaScriptEngine.m.
BOOL JSEntityIsJavaScriptSearchablePredicate | ( | Entity * | entity, |
void * | parameter ) |
Definition at line 2100 of file OOJavaScriptEngine.m.
References OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, STELLAR_TYPE_ATMOSPHERE, STELLAR_TYPE_MINIATURE, STELLAR_TYPE_MOON, STELLAR_TYPE_NORMAL_PLANET, and STELLAR_TYPE_SUN.
Referenced by FindJSVisibleEntities().
BOOL JSEntityIsJavaScriptVisiblePredicate | ( | Entity * | entity, |
void * | parameter ) |
Definition at line 2090 of file OOJavaScriptEngine.m.
References Entity::isVisibleToScripts, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
BOOL JSFunctionPredicate | ( | Entity * | entity, |
void * | parameter ) |
Definition at line 2047 of file OOJavaScriptEngine.m.
References EXPECT_NOT, JS_IsInRequest, nil, Entity::oo_jsValueInContext:, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSPauseTimeLimiter(), OOJSResumeTimeLimiter(), OOJSStartTimeLimiter, OOJSStopTimeLimiter, and OOJSValueIsFunction().
Referenced by SystemFilteredEntities().
|
static |
Definition at line 1246 of file OOJavaScriptEngine.m.
References JSArrayFromNSArray(), OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
|
static |
Definition at line 1359 of file OOJavaScriptEngine.m.
References JSObjectFromNSDictionary(), OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
|
static |
Definition at line 2520 of file OOJavaScriptEngine.m.
References nil.
|
static |
Definition at line 1280 of file OOJavaScriptEngine.m.
References EXPECT_NOT, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, and OOJSIDFromString().
Referenced by JSNewNSDictionaryValue().
|
static |
Definition at line 2514 of file OOJavaScriptEngine.m.
References OOStringFromJSValue().
BOOL OOJSArgumentListGetNumber | ( | JSContext * | context, |
NSString * | scriptClass, | ||
NSString * | function, | ||
uintN | argc, | ||
jsval * | argv, | ||
double * | outNumber, | ||
uintN * | outConsumed ) |
Definition at line 1162 of file OOJavaScriptEngine.m.
References OOJSArgumentListGetNumberNoError(), and OOJSReportBadArguments().
Referenced by QuaternionRotate(), QuaternionRotateX(), QuaternionRotateY(), QuaternionRotateZ(), SoundStaticPlayMusic(), VectorMultiply(), VectorRotationTo(), and VectorStaticInterpolate().
BOOL OOJSArgumentListGetNumberNoError | ( | JSContext * | context, |
uintN | argc, | ||
jsval * | argv, | ||
double * | outNumber, | ||
uintN * | outConsumed ) |
Definition at line 1177 of file OOJavaScriptEngine.m.
References EXPECT_NOT, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
Referenced by OOJSArgumentListGetNumber(), VectorStaticRandom(), VectorStaticRandomDirection(), and VectorStaticRandomDirectionAndLength().
id OOJSBasicPrivateObjectConverter | ( | JSContext * | context, |
JSObject * | object ) |
Definition at line 2441 of file OOJavaScriptEngine.m.
Referenced by InitOOJSConsole(), InitOOJSDock(), InitOOJSEntity(), InitOOJSEquipmentInfo(), InitOOJSExhaustPlume(), InitOOJSFlasher(), InitOOJSManifest(), InitOOJSPlanet(), InitOOJSPlayer(), InitOOJSPlayerShip(), InitOOJSScript(), InitOOJSShip(), InitOOJSShipGroup(), InitOOJSSound(), InitOOJSSoundSource(), InitOOJSStation(), InitOOJSSun(), InitOOJSSystemInfo(), InitOOJSTimer(), InitOOJSVisualEffect(), InitOOJSWaypoint(), and InitOOJSWormhole().
NSString * OOJSDescribeLocation | ( | JSContext * | context, |
JSStackFrame * | stackFrame ) |
Definition at line 894 of file OOJavaScriptEngine.m.
References GetLocationNameAndLine(), nil, sConsoleEvalLineNo, and sConsoleScriptName.
Referenced by OOJSDumpStack().
NSString * OOJSDescribeValue | ( | JSContext * | context, |
jsval | value, | ||
BOOL | abbreviateObjects ) |
Definition at line 1736 of file OOJavaScriptEngine.m.
References DescribeValue().
Referenced by DumpVariable(), and OOJSReportBadPropertyValue().
NSDictionary * OOJSDictionaryFromJSObject | ( | JSContext * | context, |
JSObject * | object ) |
Definition at line 2247 of file OOJavaScriptEngine.m.
References EXPECT_NOT, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSNativeObjectFromJSValue(), and OOStringFromJSString().
Referenced by OOJSDictionaryFromJSValue().
NSDictionary * OOJSDictionaryFromJSValue | ( | JSContext * | context, |
jsval | value ) |
Definition at line 2232 of file OOJavaScriptEngine.m.
References EXPECT_NOT, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, and OOJSDictionaryFromJSObject().
NSDictionary * OOJSDictionaryFromStringTable | ( | JSContext * | context, |
jsval | tableValue ) |
Definition at line 2307 of file OOJavaScriptEngine.m.
References EXPECT_NOT, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOStringFromJSString(), and OOStringFromJSValueEvenIfNull().
Referenced by GlobalExpandDescription(), and GlobalExpandMissionText().
void OOJSDumpStack | ( | JSContext * | context | ) |
Definition at line 737 of file OOJavaScriptEngine.m.
References DumpVariable(), EXPECT_NOT, kOOLogException, nil, OOJSDescribeLocation(), OOLog, OOStringFromJSString(), and sErrorHandlerStackSkip.
Referenced by NSString(OOJavaScriptExtensions)::concatenationOfStringsFromJavaScriptValues:count:separator:inContext:, OperationCallback(), and ReportJSError().
jsid OOJSIDFromString | ( | NSString * | string | ) |
Definition at line 943 of file OOJavaScriptEngine.m.
References EXPECT, EXPECT_NOT, nil, OOJSAcquireContext(), and OOJSRelinquishContext().
Referenced by JSObjectFromNSDictionary().
void OOJSInitJSIDCachePRIVATE | ( | const char * | name, |
jsid * | idCache ) |
Definition at line 925 of file OOJavaScriptEngine.m.
References EXPECT_NOT, OOJSAcquireContext(), and OOJSRelinquishContext().
BOOL OOJSIsSubclass | ( | JSClass * | putativeSubclass, |
JSClass * | superclass ) |
Definition at line 2163 of file OOJavaScriptEngine.m.
References sRegisteredSubClasses.
Referenced by OOJSIsMemberOfSubclass(), and OOJSObjectGetterImplPRIVATE().
void OOJSMarkConsoleEvalLocation | ( | JSContext * | context, |
JSStackFrame * | stackFrame ) |
Definition at line 918 of file OOJavaScriptEngine.m.
References GetLocationNameAndLine(), sConsoleEvalLineNo, and sConsoleScriptName.
Referenced by SpecialMarkConsoleEntryPoint().
id OOJSNativeObjectFromJSObject | ( | JSContext * | context, |
JSObject * | tableObject ) |
Definition at line 2400 of file OOJavaScriptEngine.m.
References nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSGetClass(), and sObjectConverters.
Referenced by ConsoleClearConsole(), ConsoleSettingsDeleteProperty(), ConsoleSettingsGetProperty(), ConsoleSettingsSetProperty(), GetParameterDictionary(), GlobalSetExtraGuiScreenKeys(), MissionMarkSystem(), MissionUnmarkSystem(), OOJSNativeObjectFromJSValue(), OOJSNativeObjectOfClassFromJSObject(), OOJSObjectWrapperToString(), ShipSetCrew(), ShipSetMaterialsInternal(), ShipStaticSetShipDataForKey(), StationAddShipToShipyard(), SystemSetPopulator(), and VisualEffectSetMaterialsInternal().
id OOJSNativeObjectFromJSValue | ( | JSContext * | context, |
jsval | value ) |
Definition at line 2368 of file OOJavaScriptEngine.m.
References nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSNativeObjectFromJSObject(), and OOStringFromJSValue().
Referenced by ConsoleSettingsSetProperty(), JSArrayConverter(), JSValueToEquipmentKeyRelaxed(), MissionSetInstructionsInternal(), OOJSDictionaryFromJSObject(), OOJSNativeObjectOfClassFromJSValue(), OoliteCompareVersion(), PlayerSetEscapePodDestination(), PlayerShipSetCustomHUDDial(), ShipRunLegacyScriptActions(), SystemInfoSetPropertyMethod(), and SystemInfoStaticSetInterstellarProperty().
id OOJSNativeObjectOfClassFromJSObject | ( | JSContext * | context, |
JSObject * | object, | ||
Class | requiredClass ) |
Definition at line 2433 of file OOJavaScriptEngine.m.
References nil, and OOJSNativeObjectFromJSObject().
Referenced by ConsoleConsoleMessage(), ScriptAddProperty(), SystemInfoGetProperty(), and SystemInfoSetProperty().
id OOJSNativeObjectOfClassFromJSValue | ( | JSContext * | context, |
jsval | value, | ||
Class | requiredClass ) |
Definition at line 2425 of file OOJavaScriptEngine.m.
References nil, and OOJSNativeObjectFromJSValue().
Referenced by OOShipGroup(OOJavaScriptExtensions)::oo_clearJSSelf:, PlayerShipCancelDockingRequest(), PlayerShipEngageAutopilotToStation(), PlayerShipRequestDockingClearance(), ShipGroupAddShip(), ShipGroupConstruct(), ShipGroupRemoveShip(), ShipGroupSetProperty(), ShipSetProperty(), and SoundFromJSValue().
JSObject * OOJSObjectFromNativeObject | ( | JSContext * | context, |
id | object ) |
Definition at line 1442 of file OOJavaScriptEngine.m.
References OOJSValueFromNativeObject().
BOOL OOJSObjectGetterImplPRIVATE | ( | JSContext * | context, |
JSObject * | object, | ||
JSClass * | requiredJSClass, | ||
Class | requiredObjCClass, | ||
const char * | name, | ||
id * | outObject ) |
Definition at line 2180 of file OOJavaScriptEngine.m.
References EXPECT_NOT, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSGetClass(), OOJSIsSubclass(), OOJSReportError(), and OOStringFromJSValue().
void OOJSObjectWrapperFinalize | ( | JSContext * | context, |
JSObject * | this ) |
Definition at line 2001 of file OOJavaScriptEngine.m.
References nil, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT_VOID.
JSBool OOJSObjectWrapperToString | ( | JSContext * | context, |
uintN | argc, | ||
jsval * | vp ) |
Definition at line 2017 of file OOJavaScriptEngine.m.
References nil, OOJS_NATIVE_ENTER, OOJS_NATIVE_EXIT, OOJS_RETURN_OBJECT, OOJS_THIS, OOJSGetClass(), and OOJSNativeObjectFromJSObject().
void OOJSRegisterObjectConverter | ( | JSClass * | theClass, |
OOJSClassConverterCallback | converter ) |
Definition at line 2454 of file OOJavaScriptEngine.m.
References nil, and sObjectConverters.
Referenced by InitOOJSConsole(), InitOOJSDock(), InitOOJSEntity(), InitOOJSEquipmentInfo(), InitOOJSExhaustPlume(), InitOOJSFlasher(), InitOOJSManifest(), InitOOJSMissionVariables(), InitOOJSPlanet(), InitOOJSPlayer(), InitOOJSPlayerShip(), InitOOJSScript(), InitOOJSShip(), InitOOJSShipGroup(), InitOOJSSound(), InitOOJSSoundSource(), InitOOJSStation(), InitOOJSSun(), InitOOJSSystemInfo(), InitOOJSTimer(), InitOOJSVisualEffect(), InitOOJSWaypoint(), and InitOOJSWormhole().
void OOJSRegisterSubclass | ( | JSClass * | subclass, |
JSClass * | superclass ) |
Definition at line 2141 of file OOJavaScriptEngine.m.
References sRegisteredSubClasses.
Referenced by InitOOJSDock(), InitOOJSExhaustPlume(), InitOOJSFlasher(), InitOOJSPlanet(), InitOOJSPlayerShip(), InitOOJSShip(), InitOOJSStation(), InitOOJSSun(), InitOOJSVisualEffect(), InitOOJSWaypoint(), and InitOOJSWormhole().
void OOJSReportBadArguments | ( | JSContext * | context, |
NSString * | scriptClass, | ||
NSString * | function, | ||
uintN | argc, | ||
jsval * | argv, | ||
NSString * | message, | ||
NSString * | expectedArgsDescription ) |
Definition at line 1139 of file OOJavaScriptEngine.m.
References nil, and OOJSReportErrorForCaller().
Referenced by ClockAddSeconds(), ClockClockStringForTime(), OOManifest::dealloc, FontMeasureString(), DockEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, StationEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, GetRelativeToAndRange(), GetThisQuaternion(), GetThisVector(), GlobalAddFrameCallback(), GlobalAutoAIForRole(), GlobalClearExtraGuiScreenKeys(), GlobalDisplayNameForCommodity(), GlobalExpandDescription(), GlobalExpandMissionText(), GlobalGetGuiColorSettingForKey(), GlobalGetScreenBackgroundForKey(), GlobalIsValidFrameCallback(), GlobalKeyBindingDescription(), GlobalRandomInhabitantsDescription(), GlobalRemoveFrameCallback(), GlobalSetExtraGuiScreenKeys(), GlobalSetGuiColorSettingForKey(), GlobalSetScreenBackground(), GlobalSetScreenBackgroundForKey(), GlobalSetScreenOverlay(), GlobalTakeSnapShot(), Entity(OODebugInspector)::inspect, PlayerEntity(OOJavaScriptExtensions)::javaScriptEngineWillReset:, ManifestComment(), ManifestSetComment(), ManifestShortComment(), MissionMarkSystem(), MissionRunScreen(), MissionSetInstructionsInternal(), MissionUnmarkSystem(), OOEquipmentType(OOJavaScriptExtensions)::oo_clearJSSelf:, OOShipGroup(OOJavaScriptExtensions)::oo_clearJSSelf:, OOSound(OOJavaScriptExtentions)::oo_jsClassName, OOJSArgumentListGetNumber(), PlayerAddMessageToArrivalReport(), PlayerAudioMessage(), PlayerCommsMessage(), PlayerConsoleMessage(), PlayerEndScenario(), PlayerReplaceShip(), PlayerSetEscapePodDestination(), PlayerSetPlayerRole(), PlayerShipAddParcel(), PlayerShipAddPassenger(), PlayerShipAwardContract(), PlayerShipAwardEquipmentToCurrentPylon(), PlayerShipBeginGalacticHyperspaceCountdown(), PlayerShipBeginHyperspaceCountdown(), PlayerShipCancelDockingRequest(), PlayerShipEngageAutopilotToStation(), PlayerShipHideHUDSelector(), PlayerShipRemoveContract(), PlayerShipRemoveParcel(), PlayerShipRemovePassenger(), PlayerShipRequestDockingClearance(), PlayerShipSetCustomHUDDial(), PlayerShipSetCustomView(), PlayerShipSetMultiFunctionDisplay(), PlayerShipSetMultiFunctionText(), PlayerShipSetPrimedEquipment(), PlayerShipShowHUDSelector(), PlayerShipUseSpecialCargo(), QuaternionConstruct(), QuaternionFromArgumentList(), ShipAddCargoEntity(), ShipAddCollisionException(), ShipAddDefenseTarget(), ShipAdjustCargo(), ShipAwardEquipment(), ShipCanAwardEquipment(), ShipCheckScanner(), ShipCommsMessage(), ShipDealEnergyDamage(), ShipDumpCargo(), ShipEjectItem(), ShipEjectSpecificItem(), ShipEnterWormhole(), ShipEquipmentStatus(), ShipExitSystem(), ShipGroupAddShip(), ShipGroupConstruct(), ShipGroupRemoveShip(), ShipHasEquipmentProviding(), ShipHasRole(), ShipOfferToEscort(), ShipPatrolReportIn(), ShipReactToAIMessage(), ShipRemove(), ShipRemoveCollisionException(), ShipRemoveDefenseTarget(), ShipRemoveEquipment(), ShipRunLegacyScriptActions(), ShipSendAIMessage(), ShipSetAI(), ShipSetBounty(), ShipSetCargo(), ShipSetCargoType(), ShipSetCrew(), ShipSetEquipmentStatus(), ShipSetMaterials(), ShipSetScript(), ShipSetShaders(), ShipSpawn(), ShipStaticKeysForRole(), ShipStaticRoleIsInCategory(), ShipStaticSetShipDataForKey(), ShipStaticShipDataForKey(), ShipSwitchAI(), ShipThreatAssessment(), SoundSourcePlay(), SoundStaticLoad(), SoundStaticPlayMusic(), SpecialJSWarning(), StationAbortDockingForShip(), StationAddShipToShipyard(), StationCanDockShip(), StationLaunchShipWithRole(), StationSetInterface(), StationSetMarketPrice(), StationSetMarketQuantity(), SystemAddMoon(), SystemAddPlanet(), SystemAddShipsOrGroup(), SystemAddShipsOrGroupToRoute(), SystemAddVisualEffect(), SystemCountEntitiesWithScanClass(), SystemCountShipsWithPrimaryRole(), SystemCountShipsWithRole(), SystemEntitiesWithScanClass(), SystemFilteredEntities(), SystemInfoDistanceToSystem(), SystemInfoRouteToSystem(), SystemInfoSamplePrice(), SystemInfoSetPropertyMethod(), SystemInfoStaticFilteredSystems(), SystemInfoStaticSetInterstellarProperty(), SystemLegacyAddShips(), SystemLegacyAddShipsAt(), SystemLegacyAddShipsAtPrecisely(), SystemLegacyAddShipsWithinRadius(), SystemLegacyAddSystemShips(), SystemLegacySpawnShip(), SystemLocationFromCode(), SystemSetPopulator(), SystemSetWaypoint(), SystemShipsWithPrimaryRole(), SystemShipsWithRole(), SystemStaticInfoForSystem(), SystemStaticSystemIDForName(), SystemStaticSystemNameForID(), TimerConstruct(), VectorConstruct(), VectorFromArgumentList(), VectorFromCoordinateSystem(), VectorStaticInterpolate(), VectorToCoordinateSystem(), VisualEffectScale(), VisualEffectSetMaterials(), and VisualEffectSetShaders().
void OOJSReportBadPropertySelector | ( | JSContext * | context, |
JSObject * | thisObj, | ||
jsid | propID, | ||
JSPropertySpec * | propertySpec ) |
Definition at line 1120 of file OOJavaScriptEngine.m.
References OOJSGetClass(), OOJSReportError(), and OOStringFromJSPropertyIDAndSpec().
Referenced by ClockGetProperty(), ConsoleGetProperty(), ConsoleSetProperty(), DockGetProperty(), DockSetProperty(), EntityGetProperty(), EntitySetProperty(), EquipmentInfoGetProperty(), EquipmentInfoSetProperty(), ExhaustPlumeGetProperty(), ExhaustPlumeSetProperty(), FlasherGetProperty(), FlasherSetProperty(), OOPlanetEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, WormholeEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, GlobalGetProperty(), GlobalSetProperty(), ManifestGetProperty(), MissionGetProperty(), MissionSetProperty(), OoliteGetProperty(), PlanetGetProperty(), PlayerGetProperty(), PlayerSetProperty(), PlayerShipGetProperty(), PlayerShipSetProperty(), QuaternionGetProperty(), QuaternionSetProperty(), ShipGetProperty(), ShipGroupGetProperty(), ShipGroupSetProperty(), ShipSetProperty(), SoundGetProperty(), SoundSourceGetProperty(), SoundSourceSetProperty(), StationGetProperty(), StationSetProperty(), SunGetProperty(), SystemGetProperty(), SystemInfoGetProperty(), SystemSetProperty(), TimerGetProperty(), TimerSetProperty(), VectorGetProperty(), VectorSetProperty(), VisualEffectGetProperty(), VisualEffectSetProperty(), WaypointGetProperty(), and WormholeGetProperty().
void OOJSReportBadPropertyValue | ( | JSContext * | context, |
JSObject * | thisObj, | ||
jsid | propID, | ||
JSPropertySpec * | propertySpec, | ||
jsval | value ) |
Definition at line 1129 of file OOJavaScriptEngine.m.
References OOJSDescribeValue(), OOJSGetClass(), OOJSReportError(), and OOStringFromJSPropertyIDAndSpec().
Referenced by DockSetProperty(), EntitySetProperty(), EquipmentInfoSetProperty(), ExhaustPlumeSetProperty(), FlasherSetProperty(), OOPlanetEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, WormholeEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, GlobalSetProperty(), ManifestSetProperty(), MissionSetProperty(), PlayerSetProperty(), PlayerShipSetProperty(), QuaternionSetProperty(), ShipGroupSetProperty(), ShipSetProperty(), SoundSourceSetProperty(), StationSetProperty(), SystemSetProperty(), TimerSetProperty(), VectorSetProperty(), and VisualEffectSetProperty().
void OOJSReportError | ( | JSContext * | context, |
NSString * | format, | ||
... ) |
Definition at line 1000 of file OOJavaScriptEngine.m.
References OOJSReportErrorWithArguments().
Referenced by ConsoleClearConsole(), ConsoleConsoleMessage(), ConsoleGetProfile(), ConsoleProfile(), ConsoleSettingsDeleteProperty(), ConsoleSettingsGetProperty(), ConsoleSettingsSetProperty(), ConsoleTrace(), EntitySetProperty(), GlobalAddFrameCallback(), MissionVariablesSetProperty(), OOJSCallObjCObjectMethod(), OOJSObjectGetterImplPRIVATE(), OOJSReportBadPropertySelector(), OOJSReportBadPropertyValue(), OOJSReportErrorForCaller(), OOJSReportWrappedException(), OOJSUnconstructableConstruct(), PlayerReplaceShip(), PlayerSetEscapePodDestination(), PlayerShipRemoveAllCargo(), PlayerShipResetCustomView(), PlayerShipSetCustomView(), PlayerShipSetProperty(), RemoveOrExplodeShip(), ShipAdjustCargo(), ShipEnterWormhole(), ShipGroupConstruct(), ShipRemove(), ShipSetProperty(), SoundSourceConstruct(), SystemInfoGetProperty(), and TimerConstruct().
void OOJSReportErrorForCaller | ( | JSContext * | context, |
NSString * | scriptClass, | ||
NSString * | function, | ||
NSString * | format, | ||
... ) |
Definition at line 1010 of file OOJavaScriptEngine.m.
References CallerPrefix(), nil, and OOJSReportError().
Referenced by OOJSReportBadArguments(), ShipExitAI(), ShipExitSystem(), ShipReactToAIMessage(), ShipSendAIMessage(), ShipSetAI(), ShipSetEquipmentStatus(), ShipSetScript(), ShipSwitchAI(), SystemInfoDistanceToSystem(), SystemInfoRouteToSystem(), and SystemInfoSamplePrice().
void OOJSReportErrorWithArguments | ( | JSContext * | context, |
NSString * | format, | ||
va_list | args ) |
Definition at line 1031 of file OOJavaScriptEngine.m.
References JS_IsInRequest, and nil.
Referenced by OOJSReportError().
void OOJSReportWarning | ( | JSContext * | context, |
NSString * | format, | ||
... ) |
Definition at line 1072 of file OOJavaScriptEngine.m.
References OOJSReportWarningWithArguments().
Referenced by ConsoleConsoleMessage(), ConsoleSettingsSetProperty(), EntityFromArgumentList(), EquipmentInfoSetProperty(), OOPlanetEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, GetJSSystemInfoForSystem(), GlobalRemoveFrameCallback(), GlobalSetScreenBackground(), GlobalSetScreenOverlay(), GlobalTakeSnapShot(), ManifestSetProperty(), MissionRunScreen(), MissionRunShipLibrary(), MissionSetInstructionsInternal(), OOJSReportWarningForCaller(), PlayerShipSetProperty(), ScriptAddProperty(), ShipFireECM(), ShipSetMaterialsInternal(), ShipSetShaders(), SpecialJSWarning(), TimerSetProperty(), VisualEffectSetMaterialsInternal(), and VisualEffectSetShaders().
void OOJSReportWarningForCaller | ( | JSContext * | context, |
NSString * | scriptClass, | ||
NSString * | function, | ||
NSString * | format, | ||
... ) |
Definition at line 1082 of file OOJavaScriptEngine.m.
References CallerPrefix(), nil, and OOJSReportWarning().
Referenced by StationEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, ShipAddCargoEntity(), ShipDumpCargo(), ShipExitAI(), ShipGroupAddShip(), ShipSetEquipmentStatus(), and StationAddShipToShipyard().
void OOJSReportWarningWithArguments | ( | JSContext * | context, |
NSString * | format, | ||
va_list | args ) |
Definition at line 1103 of file OOJavaScriptEngine.m.
References nil.
Referenced by OOJSReportWarning(), and SyntaxIssue().
void OOJSReportWrappedException | ( | JSContext * | context, |
id | exception ) |
Definition at line 1050 of file OOJavaScriptEngine.m.
References OOJSReportError().
void OOJSSetWarningOrErrorStackSkip | ( | unsigned | skip | ) |
Definition at line 1156 of file OOJavaScriptEngine.m.
References sErrorHandlerStackSkip.
Referenced by SpecialJSWarning().
void OOJSStrLiteralCachePRIVATE | ( | const char * | string, |
jsval * | strCache, | ||
BOOL * | inited ) |
Definition at line 1543 of file OOJavaScriptEngine.m.
References EXPECT_NOT, OOJSAcquireContext(), and OOJSRelinquishContext().
JSBool OOJSUnconstructableConstruct | ( | JSContext * | context, |
uintN | argc, | ||
jsval * | vp ) |
Definition at line 1987 of file OOJavaScriptEngine.m.
References OOJS_NATIVE_ENTER, OOJS_NATIVE_EXIT, OOJSReportError(), and OOStringFromJSString().
Referenced by InitOOJSClock(), InitOOJSConsole(), InitOOJSDock(), InitOOJSEntity(), InitOOJSEquipmentInfo(), InitOOJSExhaustPlume(), InitOOJSFlasher(), InitOOJSManifest(), InitOOJSMission(), InitOOJSOolite(), InitOOJSPlanet(), InitOOJSPlayer(), InitOOJSPlayerShip(), InitOOJSScript(), InitOOJSShip(), InitOOJSSound(), InitOOJSStation(), InitOOJSSun(), InitOOJSSystem(), InitOOJSSystemInfo(), InitOOJSVisualEffect(), InitOOJSWaypoint(), and InitOOJSWormhole().
void OOJSUnreachable | ( | const char * | function, |
const char * | file, | ||
unsigned | line ) |
Definition at line 1063 of file OOJavaScriptEngine.m.
References OOLog, and OOLogAbbreviatedFileName().
NSString * OOStringFromJSID | ( | jsid | propID | ) |
Definition at line 975 of file OOJavaScriptEngine.m.
References nil, OOJSAcquireContext(), OOJSRelinquishContext(), and OOStringFromJSString().
Referenced by MissionVariablesSetProperty().
NSString * OOStringFromJSPropertyIDAndSpec | ( | JSContext * | context, |
jsid | propID, | ||
JSPropertySpec * | propertySpec ) |
Definition at line 1611 of file OOJavaScriptEngine.m.
References OOStringFromJSString().
Referenced by OOJSReportBadPropertySelector(), OOJSReportBadPropertyValue(), and ShipSetProperty().
NSString * OOStringFromJSString | ( | JSContext * | context, |
JSString * | string ) |
Definition at line 1562 of file OOJavaScriptEngine.m.
References EXPECT, EXPECT_NOT, nil, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
Referenced by ConsoleSettingsDeleteProperty(), ConsoleSettingsGetProperty(), ConsoleSettingsSetProperty(), KeyForPropertyID(), ManifestGetProperty(), ManifestSetProperty(), OOJSDictionaryFromJSObject(), OOJSDictionaryFromStringTable(), OOJSDumpStack(), OOJSUnconstructableConstruct(), OOStringFromJSID(), OOStringFromJSPropertyIDAndSpec(), OOStringFromJSValueEvenIfNull(), SystemInfoGetProperty(), SystemInfoSetProperty(), and WorldScriptsGetProperty().
NSString * OOStringFromJSValue | ( | JSContext * | context, |
jsval | value ) |
Definition at line 1597 of file OOJavaScriptEngine.m.
References EXPECT, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, and OOStringFromJSValueEvenIfNull().
Referenced by ConsoleConsoleMessage(), ConsoleDisplayMessagesInClass(), ConsoleIsExecutableJavaScript(), ConsoleSetDisplayMessagesInClass(), ConsoleSetProperty(), ConsoleSettingsSetProperty(), OOManifest::dealloc, FontMeasureString(), OOPlanetEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, OOWaypointEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, GetParameterString(), GlobalAutoAIForRole(), GlobalClearExtraGuiScreenKeys(), GlobalDisplayNameForCommodity(), GlobalExpandDescription(), GlobalExpandMissionText(), GlobalGetGuiColorSettingForKey(), GlobalGetScreenBackgroundForKey(), GlobalKeyBindingDescription(), GlobalLog(), GlobalSetExtraGuiScreenKeys(), GlobalSetGuiColorSettingForKey(), GlobalSetScreenBackgroundForKey(), GlobalTakeSnapShot(), JSStringConverter(), JSValueToEquipmentType(), ManifestComment(), ManifestSetComment(), ManifestShortComment(), MissionAddMessageText(), MissionRunScreen(), MissionSetInstructionsInternal(), MissionVariablesSetProperty(), OOEquipmentType(OOJavaScriptExtensions)::oo_clearJSSelf:, OOSound(OOJavaScriptExtentions)::oo_jsClassName, OOJSCallObjCObjectMethod(), OOJSNativeObjectFromJSValue(), OOJSObjectGetterImplPRIVATE(), OOStringFromDeciCredits(), PlayerAddMessageToArrivalReport(), PlayerAudioMessage(), PlayerCommsMessage(), PlayerConsoleMessage(), PlayerEndScenario(), PlayerReplaceShip(), PlayerSetPlayerRole(), PlayerSetProperty(), PlayerShipAddParcel(), PlayerShipAddPassenger(), PlayerShipAwardContract(), PlayerShipHideHUDSelector(), PlayerShipRemoveContract(), PlayerShipRemoveParcel(), PlayerShipRemovePassenger(), PlayerShipSetCustomHUDDial(), PlayerShipSetCustomView(), PlayerShipSetMultiFunctionDisplay(), PlayerShipSetMultiFunctionText(), PlayerShipSetPrimedEquipment(), PlayerShipSetProperty(), PlayerShipShowHUDSelector(), PlayerShipUseSpecialCargo(), ShipAdjustCargo(), ShipCanAwardEquipment(), ShipCommsMessage(), ShipDumpCargo(), ShipEjectItem(), ShipEjectSpecificItem(), ShipExitAI(), ShipGroupConstruct(), ShipHasEquipmentProviding(), ShipHasRole(), ShipReactToAIMessage(), ShipSendAIMessage(), ShipSetAI(), ShipSetBounty(), ShipSetCargo(), ShipSetCargoType(), ShipSetEquipmentStatus(), ShipSetProperty(), ShipSetScript(), ShipSpawn(), ShipStaticKeysForRole(), ShipStaticRoleIsInCategory(), ShipStaticSetShipDataForKey(), ShipStaticShipDataForKey(), ShipSwitchAI(), SoundFromJSValue(), SoundStaticLoad(), SoundStaticPlayMusic(), SpecialJSWarning(), StationLaunchShipWithRole(), StationSetInterface(), StationSetMarketPrice(), StationSetMarketQuantity(), StationSetProperty(), SystemAddMoon(), SystemAddPlanet(), SystemAddShipsOrGroup(), SystemAddShipsOrGroupToRoute(), SystemAddVisualEffect(), SystemCountShipsWithPrimaryRole(), SystemCountShipsWithRole(), SystemInfoRouteToSystem(), SystemInfoSamplePrice(), SystemInfoSetPropertyMethod(), SystemInfoStaticSetInterstellarProperty(), SystemLegacyAddShips(), SystemLegacyAddShipsAt(), SystemLegacyAddShipsAtPrecisely(), SystemLegacyAddShipsWithinRadius(), SystemLegacyAddSystemShips(), SystemLegacySpawnShip(), SystemLocationFromCode(), SystemSetPopulator(), SystemSetProperty(), SystemSetWaypoint(), SystemShipsWithPrimaryRole(), SystemShipsWithRole(), SystemStaticSystemIDForName(), VectorFromCoordinateSystem(), VectorToCoordinateSystem(), and VisualEffectSetProperty().
NSString * OOStringFromJSValueEvenIfNull | ( | JSContext * | context, |
jsval | value ) |
Definition at line 1584 of file OOJavaScriptEngine.m.
References JS_IsInRequest, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, and OOStringFromJSString().
Referenced by DescribeValue(), DumpVariable(), GlobalLog(), MissionSetInstructionsInternal(), OOJSDictionaryFromStringTable(), OOStringFromJSValue(), ShipSetMaterialsInternal(), ShipSetShaders(), VisualEffectSetMaterialsInternal(), and VisualEffectSetShaders().
|
static |
Definition at line 144 of file OOJavaScriptEngine.m.
References OOJSScript::currentlyRunningScript, ResourceManager::dictionaryFromFilesNamed:inFolder:andMerge:, OOJavaScriptEngine::dumpStackForErrors, OOJavaScriptEngine::dumpStackForWarnings, EXPECT_NOT, nil, OOJSDumpStack(), OOJSPauseTimeLimiter(), OOJSResumeTimeLimiter(), OOLog, OOLogWillDisplayMessagesInClass(), OOJavaScriptEngine::sendMonitorError:withMessage:inContext:, sErrorHandlerStackSkip, OOJavaScriptEngine::sharedEngine, OOJavaScriptEngine::showErrorLocations, and OOJSScript::weakRetain.
|
static |
Definition at line 2475 of file OOJavaScriptEngine.m.
References DESTROY, and sObjectConverters.
|
static |
Definition at line 2156 of file OOJavaScriptEngine.m.
References sRegisteredSubClasses.
JSContext* gOOJSMainThreadContext = NULL |
Definition at line 97 of file OOJavaScriptEngine.m.
Referenced by OOJSAcquireContext(), and OOJSRelinquishContext().
NSString* const kOOJavaScriptEngineDidResetNotification = @"org.aegidian.oolite OOJavaScriptEngine did reset" |
Definition at line 101 of file OOJavaScriptEngine.m.
NSString* const kOOJavaScriptEngineWillResetNotification = @"org.aegidian.oolite OOJavaScriptEngine will reset" |
Definition at line 100 of file OOJavaScriptEngine.m.
|
static |
Definition at line 867 of file OOJavaScriptEngine.m.
Referenced by OOJSDescribeLocation(), and OOJSMarkConsoleEvalLocation().
|
static |
Definition at line 866 of file OOJavaScriptEngine.m.
Referenced by OOJSDescribeLocation(), and OOJSMarkConsoleEvalLocation().
|
static |
Definition at line 95 of file OOJavaScriptEngine.m.
Referenced by OOJSDumpStack(), OOJSSetWarningOrErrorStackSkip(), and ReportJSError().
|
static |
Definition at line 2365 of file OOJavaScriptEngine.m.
Referenced by OOJSNativeObjectFromJSObject(), OOJSRegisterObjectConverter(), and UnregisterObjectConverters().
|
static |
Definition at line 2139 of file OOJavaScriptEngine.m.
Referenced by OOJSIsSubclass(), OOJSRegisterSubclass(), and UnregisterSubclasses().
|
static |
Definition at line 94 of file OOJavaScriptEngine.m.