Commit Graph

13 Commits

Author SHA1 Message Date
Josh Tynjala
c81ad95ae5 output.js: fix broken breakpoints in debug builds (closes #1872)
::SOURCE_FILE:: must appear on the first line so that the .js.map line numbers match with our generated .js file line numbers

Added a comment to explain why that part of the file isn't formatted nicely with line breaks like the rest of the file.

This partially reverts bbcb8bea07
2024-12-09 09:23:12 -08:00
Joshua Granick
88e21e6cc9 Fix JS, minor improvements to readability after generate 2024-07-09 10:53:53 -07:00
Joseph Cloutier
2874ac9cab Use globalThis.
It's designed to solve exactly this problem, and has been universally available since 2020.

The most likely scenario for `globalThis` to fail is if the user is stuck with an old browser, in which case `self` will be available. `window` will be too, but `self` also works in web workers.
2024-06-10 14:26:46 -04:00
Joseph Cloutier
832ac358c1 Use === and !== in output.js. 2024-06-10 14:14:39 -04:00
Joseph Cloutier
bbcb8bea07 Format output.js for readability. 2024-06-10 14:12:19 -04:00
Joseph Cloutier
8066037cdd Bug fix: Node.js was being treated as a web worker context. 2024-06-10 14:07:22 -04:00
Joseph Cloutier
630aa1a62f Fix web worker errors.
It took a lot of work to get web workers to work, but web workers finally work!

`transferList` doesn't seem to work, though. It makes the object
inaccessible as expected, but it doesn't seem to affect performance.
2022-02-28 19:15:19 -05:00
Kostas Chatzikokolakis
d969c7fa30 output.js: add AMD compatibility
If the code is loaded via AMD/requirejs:
- we call define() instead of exporting 'lime' globally
- we disable AMD while the embedded libraries are loading, so that they
  register themselves in the global scope.
2019-06-12 11:51:36 -07:00
Joshua Granick
42649d1b9a Improve output HTML5 script wrapper for better Haxe 3.2 support 2019-04-03 11:31:49 -07:00
Joshua Granick
970aaa979c Fix HTML5 output template on debug 2019-03-29 17:06:43 -07:00
Joshua Granick
914e94f9e5 Fix line numbers for HTML5 source maps 2019-03-29 15:58:03 -07:00
Joshua Granick
cac82509da Add support for embedded JS dependencies (embed Lime dependencies by default) 2019-02-12 13:30:07 -08:00
Joshua Granick
3e9f875eaf Process JS using template, add support for unique statics in repeat lime.embed calls 2019-02-12 13:14:40 -08:00