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
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
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
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
445b08b3e2
Stomped "Left hand side has no effect" in non-JS_THREADSAFE builds.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4006 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 18:51:15 +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
4caf9301ae
A bunch of JS callback cleanup, mostly explicit void returns.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3953 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 17:46:53 +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
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
e2f537ef59
Mac Oolite-newjs builds now use an Xcode project to build libjs.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3912 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-28 22:56:25 +00:00
Jens Ayton
a109ca603f
Fixed oldjs crashes in system ship-finding methods, and reduced number of #if OO_NEW_JSes in the process.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3897 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-21 21:02:38 +00:00
Jens Ayton
3048213ec0
Fixed Vector3D and Quaternion constructors under new JS regime.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3887 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-19 14:19:57 +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
776b504220
Fixed an unused variable warning in optimized builds.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3858 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-17 11:47:45 +00:00
Jens Ayton
9edf4e9f5e
Work on JavaScript API update.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3856 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-17 11:28:03 +00:00
Jens Ayton
295c921403
Work on JavaScript API update.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3853 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-15 23:21:25 +00:00
Nikos Barkas
ec9b9f10f5
Fixed Windows build breakage.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3852 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 23:44:54 +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
954abef139
* escape pods changes:
...
- while inside the escape pod, stopped js from accessing Ship & PlayerShip properties of player.ship (while in the pod, we still had access to all the equiment inside the original player.ship, etc...)
- new js function: player.setEscapePodDestination() - takes 1 argument to override the standard destination (main station, or none if in witchspace). Accepts either null/false, a specific station inside the current system, or the string 'NEARBY_SYSTEM' to send the rescued capsule to a nearby system's main station - can only be used while inside the pod, via one of the 2 pod triggered events (or the debug console!).
- collision when docking: removed second AI collision message, to prevent carriers from moving about in reaction to a bad docking.
- some cleanup & minor code optimisation...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3815 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-14 22:19:28 +00:00
Jens Ayton
b775065f76
Profiling everywhere.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3634 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-27 19:35:22 +00:00
Jens Ayton
4d3849a609
Fixed a fix for Mac OS X. Where does that leave Linux?
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3627 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-27 15:33:12 +00:00
Nikos Barkas
2918deeccc
Fixed compile error under Windows.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3625 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-27 14:14:03 +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
6f9f338732
Fixed a bunch of syntax errors flagged by Apple-Clang 1.5. Switched default compiler for 64-bit Mac OS X build to LLVM-GCC (because using Clang causes a linker crash). To build under Leopard, it will be necessary to change back; see src/Cocoa/oolite-targets.xcconfig.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3587 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-21 23:08:06 +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
Jens Ayton
2d7a435327
Include full path in stack trace for files named script.js/. Extended time limit for script loading and startUp().
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3550 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 22:36:48 +00:00
Jens Ayton
00ffca2f26
Implemented rudimentary stack backtrace for JavaScript.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3548 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 20:28:22 +00:00
Jens Ayton
844b875396
Added basic profiling facility for JavaScript. Examples of use:
...
console.profile(function(){ console.shaderMode = "SHADERS_OFF"; });
or
:profile console.shaderMode = "SHADERS_OFF"
either of which print a string like:
0.94239 seconds (2.00559e-05 seconds JavaScript, 0.94237 seconds extension
time)
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3543 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 16:28:42 +00:00
Jens Ayton
0e9ee84562
Added some documentation for JS script limiter in OOJavaScriptEngine.h. Pause limiter while spawning ships or planets, and while searching entities.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3529 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-13 19:13:09 +00:00
Jens Ayton
528abd2ac6
Implemented time limiter for JavaScript scripts. Set to be extremely aggressive for testing.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3528 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-13 18:51:07 +00:00
Jens Ayton
b2220bf4f8
Fixed crash with repeated transient uses of JS EquipmentTypes - triggered by Cataclysm and almost certainly lots of others.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3496 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-11 10:36:08 +00:00
Jens Ayton
dcd183bae9
Fixed bad GC roots in OOJSFunction. Avoid extra allocation in JS Timer constructor.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3472 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-06 12:31:51 +00:00
Jens Ayton
073b32262e
Don't use named JS GC roots in release builds.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3290 127b21dd-08f5-0310-b4b7-95ae10353056
2010-05-05 17:11:11 +00:00
Marc
f7affbc01a
MissionScreen RFC part II:
...
* missionScreenOpportunity now fires up after loading a savegame & at startup, as well as after docking.
* fixed a mission callback related crash.
* fixed clash with fines and mission screens.
* name change for new mission.runScreen parameter shipModel: is now showModel.
* the foreground & background images now display correctly in relation to the spinning demo ship.
- code cleanup
- added missing keys to the shipdata entry schema
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2758 127b21dd-08f5-0310-b4b7-95ae10353056
2009-11-17 18:27:11 +00:00
Marc
7bb627586f
* New mission.setInstructions to go with mission.setInstructionsKey, analogous to the mission.addText / mission.addTextKey pair.
...
* mission RFC part I. Initial implementation of the changes proposed in the forum. Will need tweaking.
* added new parameters to mission: title & foregroundImage (identical to backgroundImage atm)
* assorted code tidying up.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2750 127b21dd-08f5-0310-b4b7-95ae10353056
2009-11-15 00:24:23 +00:00
Marc
89df01f9bb
* fix: js timers should now stop and be garbage collected when the script they're attached to goes out of scope.
...
* fix: timer related windows DEP crashes should now be a thing of the past. Tested with timer-crash-test oxp & windows XP Data Execution Prevention turned on.
Both fixes seem fine, but we'll need to test them thoroughly.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2724 127b21dd-08f5-0310-b4b7-95ae10353056
2009-11-06 03:14:32 +00:00