151 Commits

Author SHA1 Message Date
Jens Ayton
08519fb6be JS special.jsWarning() now skips one stack frame as intended.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4077 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-16 14:04:17 +00:00
Jens Ayton
404cea6b3e Added assertion for possible but unlikely cause of Scree't crash in http://aegidian.org/bb/viewtopic.php?f=3&t=8978
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4076 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-16 13:19:55 +00:00
Jens Ayton
96c9b7dbe6 More macro madness! JS scanClass and status strings are now interned singletons, for efficiency and also simpler callbacks.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4073 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-15 17:49:14 +00:00
Jens Ayton
676ed097e9 Cleaned up JS debug helpers, made them easier to use and added some basic documentation.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4071 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-15 14:25:49 +00:00
Jens Ayton
9e25713f53 oldjs unbreakage.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4069 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 22:17:59 +00:00
Jens Ayton
9dad469a36 API compatibility with FireFox 4.0 beta 9 version of SpiderMonkey (string functions have changed). Update to 4b9 for OS X not pushed yet; SoundSources don't work.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4068 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 22:08:38 +00:00
Jens Ayton
99fc874443 Garbage collect when docking.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4065 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 20:36:34 +00:00
Jens Ayton
35de1488c1 Added OOJSValueIsFunction() and OOJSValueIsArray() helper functions, and used them to avoid several JS crashers.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4064 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 20:17:07 +00:00
Jens Ayton
65ae9f162a Added debug-only JS functions debugConsole.dumpHeap() (newjs only) and debugConsole.dumpNamedRoots(). They write to text files in the log folder.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4063 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 20:04:21 +00:00
Jens Ayton
19c65c4e4c Build fixage.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4062 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 19:32:12 +00:00
Jens Ayton
7f0424efb6 Fixed deployment build. Mathematical mucking about.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4060 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 18:32:25 +00:00
Jens Ayton
1795bd6f9e Changed stack trace log message class.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4058 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 17:02:50 +00:00
Jens Ayton
3509adfab7 Added another debug helper, JSValueToStrSafeDbg, suitable for Xcode data formatter or gdb display expression.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4057 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 16:45:52 +00:00
Jens Ayton
5f16e93f3f oldjs unbreakage.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4056 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 16:03:24 +00:00
Jens Ayton
22e30e422f JavaScript stack traces now include local variables. Stack trace configuration behaviour changed: instead of logcontrol.plist settings, traces for errors and warnings can be separately enabled/disabled through the debug console, or through preferences if debug OXP is not installed. Default is on with debug OXP, off otherwise. Settings in the debug console are persistent, as are showErrorLocations and showErrorLocationsDuringConsoleEval now.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4055 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 15:48:05 +00:00
Jens Ayton
4c23525ddd Mucked about a bit with data formatter functions for GDB (those would be JSValueToStrDbg, JSObjectToStrDbg, JSStringToStrDbg, JSValueTypeDbg and now JSDumpStack, BTW). Implemented basic support for JS debugger statement - currently just logs a stack trace, if the debug console is active.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4054 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-14 14:05:51 +00:00
Jens Ayton
56f5e760ce Implemented frame callbacks.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4035 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-08 17:03:04 +00:00
Jens Ayton
549d873f0b Added constructor callback to all JS pseudoclasses, so that the instanceof operator and constructor property behave sanely.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4018 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-06 18:07:48 +00:00
Jens Ayton
8589c5a13e Optimized JS-to-native string converters to avoid up to three unnecessary class method calls. Informally deprecated stringWithJavaScriptString:, stringWithJavaScriptValue:inContext: and stringOrNilWithJavaScriptValue:inContext: in favour of OOStringFromJSString(), OOStringFromJSValueEvenIfNull() and OOStringFromJSValue() (formerly OOJSValToNSString()).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4011 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 22:13:17 +00:00
Jens Ayton
7fd1f70f04 Implemented watchdog timer for newjs.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4008 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 21:47:45 +00:00
Jens Ayton
124ba843b5 New OOJS_BEGIN_FULL_NATIVE()/OOJS_END_FULL_NATIVE macros bracket potentially-slow blocks of ObjC code called from JS callbacks, mostly replacing OOJSPauseTimeLimiter()/OOJSResumeTimeLimiter(). In addition to frobbing the time limiter, they handle JS request management.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4005 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 14:29:30 +00:00
Jens Ayton
6e515e60ed Big renaming of JavaScript helpers for internal consistency and clarity.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4004 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 12:58:27 +00:00
Jens Ayton
ec371a8511 JS expandDescription() and expandMissionText() override parameters are now stringified the JavaScript way rather than by coercing them to ObjC objects and calling -description.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3999 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-04 17:40:47 +00:00
Jens Ayton
cb8597bc7d JavaScript warnings (but not errors) which are squelched in logcontrol.plist are now hidden from the JS console too.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3993 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-04 15:24:45 +00:00
Jens Ayton
4fac70192f Cleaned up oolite-default-ship-script.js for strict mode.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3963 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-03 00:27:00 +00:00
Jens Ayton
c7e0b2d17e Fixed non-debug builds.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3948 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 15:48:38 +00:00
Jens Ayton
ecfef79f97 File and line information is now suppressed for code called through the console.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3946 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 13:41:50 +00:00
Jens Ayton
96df45381e Further tightened new JS underlying object accessors, and fixed test case regressions for the implicit-conversion-from-entity case.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3943 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 12:26:36 +00:00
Nikos Barkas
b57f41acaf Fixed build breakage when JS_THREADSAFE was not defined.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3942 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 09:44:17 +00:00
Jens Ayton
9aa698b483 All JS Ship methods now get their "this" value consistently, including treating the player ship as non-existent during the escape pod sequence, and in a way that isn't trivially crashed - for example, Ship.setAI.call(new Vector3D, "") now works as expected, i.e. raises a JS exception.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3938 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-31 16:08:04 +00:00
Jens Ayton
ded11b65a3 Made JSEntityGetEntity() and similar accessors more efficient. Started work of making native callbacks explicitly return VOID when necessary, as this is no longer handled implicitly when not setting a return value.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3937 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-31 15:30:07 +00:00
Jens Ayton
b057dcfeb3 Enabled method JIT (JaegerMonkey) in Mac newjs builds. Activated JIT in non-debug builds on all platforms.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3924 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-30 14:30:11 +00:00
Jens Ayton
fc134f42c9 Fixed oldjs NSDictionary -> JS Object coersion handler. Fixed return value of console.getProfile().
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3911 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-26 15:39:38 +00:00
Jens Ayton
6d86b802e8 JS String and Number objects can now be coerced to NSString and NSNumber using JSObjectToObject(). In practical terms, this means callObjC() now works on them. Also cleaned up some error messages pertaining to callObjC().
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3910 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-26 14:04:32 +00:00
Jens Ayton
049ac7a1bf Fixed JS timers in newjs.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3892 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-19 20:08:43 +00:00
Jens Ayton
2aa48deafc Fixed newjs method calls. Game now runs and console works, but crashes in unit tests because constructors are written wrong.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3886 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-19 13:52:00 +00:00
Jens Ayton
abdf19a77a More requestificiation.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3884 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-18 23:01:06 +00:00
Jens Ayton
25b8310c6c New JS work: fixed a rooting error and added a bunch of requests.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3883 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-18 22:15:27 +00:00
Jens Ayton
cf81db538f Work on JavaScript API update: began work on meeting thread-safe API requirements. Game now loads and runs with trunk libjs.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3861 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-17 14:45:55 +00:00
Jens Ayton
10639d6f52 Work on JavaScript API update.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3859 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-17 12:47:53 +00:00
Jens Ayton
a655c81d87 Work on JavaScript API update: updated all property callbacks.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3850 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 20:13:39 +00:00
Jens Ayton
75381a4f59 Work on JavaScript API update; all use of JSExtendedClass/JSEqualityOp removed. ==/!= no longer works for distinct Oolite-defined objects. This primarily affects Vector3D and Quaternion.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3849 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 19:10:23 +00:00
Jens Ayton
07c6aa06c9 Work on JavaScript API update.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3848 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 18:58:07 +00:00
Jens Ayton
1242dfdd67 Work on JavaScript API update.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3845 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 16:22:26 +00:00
Marc
ec4a512194 * Primable equipment! Use shift-n to select, and n to activate the equipment.
- New primed equipment key in savegames.
- Equipment scripts only respond to the activate event.
- Equipment scripts have access to this.equipmentKey, which contains the equipment type the script is associated to (e.g. 'EQ_WHATEVER')
* More commsMessage stuff:
- new parameter: ship.commsMessage(message [, toShip]) the second - optional - parameter now allows for narrowcast, as opposed to generic broadcast within scanner range - in crowded systems it's faster to narrowcast to a couple of ships, than to just broadcast the message to all ships in range!
- commsMessageReceived event: the ship sending the message is now passed as a second parameter to the event handler.
* new equipmentInfo property: scriptName
* new ship property: isPiloted
* assorted code cleanup...

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3799 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-10 21:49:23 +00:00
Jens Ayton
0ffdb23b86 Fixed a JS crash.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3726 127b21dd-08f5-0310-b4b7-95ae10353056
2010-07-28 14:32:05 +00:00
Marc
2448a4f38f - OK, now all copyright notices inside the code should be up to date!
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3654 127b21dd-08f5-0310-b4b7-95ae10353056
2010-07-03 18:45:37 +00:00
Jens Ayton
18bebd07c7 Started deploying profiling and thread-safety macros - even if they don't work in Windows, they're useful elsewhere. Profiling is now used on all Vector3D and Quaternion methods, all System methods, and the hot path for System.addShips(). Disabled aggressive JS GC testing in Mac TestRelease builds, so that profiling results are vaguely useful.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3623 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-27 13:25:08 +00:00
Jens Ayton
5ea3215c1c Cleaned up JS exception wrapper stuff.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3588 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-22 18:08:10 +00:00
Jens Ayton
32e1884e05 Groovy yet horrible macros to automate conversion of ObjC macros to JavaScript macros, and also profile individual native callbacks. More info in the Top Secret Mailing List Treehouse.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3586 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-21 18:07:47 +00:00