Commit Graph
3934 Commits
Author SHA1 Message Date
Thomas Weber bfa6cdde8a Write tests for our changes to clock and keyboard 2020-09-17 15:31:04 -05:00
Thomas Weber cb9c0c56fd Merge branch 'develop' of https://github.com/TurboWarp/scratch-vm into develop 2020-09-17 15:07:48 -05:00
Thomas Weber 80a3d2eea6 Create node.js.yml 2020-09-17 15:06:17 -05:00
Thomas Weber 95604ad3fc Disable documentation script
Doesn't seem to work. Not used anyways.
2020-09-17 15:05:16 -05:00
Thomas Weber 28923f57ec Merge branch 'develop' of https://github.com/llk/scratch-vm into develop 2020-09-17 14:58:56 -05:00
Thomas Weber 97956235c0 Test compiled and non-compiled versions of projects 2020-09-17 14:58:43 -05:00
Thomas Weber de0d8407e2 js: Fix error when target does not have a sprite
This happens in tests.
2020-09-17 14:51:59 -05:00
Thomas Weber d55b2593a5 Reenable io_clock.js cycle test because it passes again 2020-09-17 14:49:25 -05:00
Thomas Weber 61cc84243a Make Clock function like it does upstream and also add a precise timer
This makes Clock's API function as it does upstream (with runtime.currentMSecs)
It also adds another Timer to Clock that uses real time. This is used in places where we explicitly want precise time.
2020-09-17 14:48:36 -05:00
Thomas Weber 2ae1d66616 Disable tests that we intentionally break 2020-09-17 14:31:43 -05:00
Thomas Weber be19cb924d Import emit fast where it's actually used 2020-09-17 14:31:29 -05:00
Thomas Weber bb64cd7ec8 Support "last key pressed" outside of compiler 2020-09-17 14:20:34 -05:00
Thomas Weber f380960e25 js: acos and asin can return NaN 2020-09-16 21:53:09 -05:00
Thomas Weber 1554781ee8 Remove extra whitespace 2020-09-16 21:53:01 -05:00
Thomas Weber 6a323615d5 ast+execute+js: compile sensing_distanceto 2020-09-16 21:49:24 -05:00
Eric Rosenbaum 9329f93e74 Merge pull request #2557 from ericrosenbaum/broadcast-wait-var-change-fix
Prevent "broadcast and wait" being interrupted by a change to its input
2020-09-16 17:52:28 -04:00
Thomas Weber 85afda866a js: Round size 2020-09-12 12:16:14 -05:00
Thomas Weber 16e749dabf ast: Less aggressively skip unnecessary analysis to fix errors from recursive functions 2020-09-12 00:19:08 -05:00
Thomas Weber 4608e339fe js: Use unshift() instead of splice() for insert at 1 of list 2020-09-11 15:27:47 -05:00
Thomas Weber e3f3bbe77c Use emitFast in some hotspots 2020-09-11 14:44:06 -05:00
Thomas Weber 954a88582e Add EventEmitter.emitFast 2020-09-11 14:43:41 -05:00
Thomas Weber f81aac7af2 ast+js: Direction recursion should yield (#18)
This is still not perfect, as Scratch will search the last 5 calls to determine if a function recurses.
However, this covers the 90% case without introducing significant overhead.
2020-09-11 13:41:07 -05:00
Thomas Weber 9e03e28c9b ast: Convert list.delete to list.deleteAll when input is constant "all" 2020-09-10 18:15:10 -05:00
Thomas Weber 0b3ac86385 js: Remove isConstantInput 2020-09-10 16:30:18 -05:00
Thomas Weber bca19a7efa js: Restore variable type inference with less bugs 2020-09-10 16:29:45 -05:00
Thomas Weber c7a4f4cde0 Revert "js: Optimize op.equals when comparing against a constant 0"
This reverts commit 3ed2fffa0b.
2020-09-10 12:16:36 -05:00
Thomas Weber 4a0d27af76 execute: Fix listIndex 2020-09-10 11:21:33 -05:00
Thomas Weber 5a2b3e115d Revert "js: Optimize op.less when right side is always a number"
This reverts commit 36ee6f65de.
2020-09-10 11:09:17 -05:00
Thomas Weber e8d1e449a9 execute: Optimize listIndex 2020-09-09 22:03:56 -05:00
Thomas Weber 80e0bccabc js: Use bitwise | 0 instead of Math.floor in list.get optimization
This is a lot more significant than I imagined it would be.
2020-09-09 22:03:24 -05:00
Thomas Weber 94f09e10b2 js+execute: Remove listGetFast
The ?? operator is used instead.
Older browsers now simply won't get this optimization.
2020-09-09 22:03:24 -05:00
Thomas Weber 36ee6f65de js: Optimize op.less when right side is always a number 2020-09-09 21:52:35 -05:00
Thomas Weber 3ed2fffa0b js: Optimize op.equals when comparing against a constant 0 2020-09-09 21:52:28 -05:00
Thomas Weber e5fa43b452 js: Improve sanitize 2020-09-09 14:42:31 -05:00
Thomas Weber eebd40fec4 Add Input.asNumberOrNaN
Might be used later
2020-09-09 14:29:50 -05:00
Thomas Weber f190934150 Merge branch 'develop' of https://github.com/llk/scratch-vm into develop 2020-09-03 15:13:06 -05:00
DD Liu 7c652246df Merge pull request #2356 from adroitwhiz/cast-to-black
Cast malformed color hex strings to RGBA 0,0,0,255 instead of null
2020-09-03 15:52:52 -04:00
Thomas Weber 7b739fc7f9 js: Nuke VariableInput and Frame 2020-08-31 21:20:59 -05:00
Thomas Weber a4f096ae8d js: remove inheritValues (#15)
The caching of VariableInputs was causing one stack to incorrectly affect another stack.
The fix is to remove inheritValues entirely until a better method of doing this can be found.
A third phase of compilation is the most likely thing.
2020-08-31 19:40:20 -05:00
Thomas Weber 25fc927522 Fix code style 2020-08-31 15:26:00 -05:00
Thomas Weber 37c313b3a1 Use new Function instead of eval when testing for nullish coalescing operator 2020-08-31 15:25:54 -05:00
Thomas Weber f999252917 execute: Cleanup some code 2020-08-31 15:23:19 -05:00
Thomas Weber c50aeaf740 Revert "js: Remove type from VariableInput"
This reverts commit 8f66924fe9.
2020-08-30 16:37:25 -05:00
Thomas Weber 8f66924fe9 js: Remove type from VariableInput 2020-08-30 16:25:14 -05:00
Thomas Weber 9e9b414620 js: Fix VariableInput infinite recursion 2020-08-30 16:09:56 -05:00
Thomas Weber c4bb8fabba js: Use Object.create(null) for variable input cache
This should fix some potential problems when a variable has an ID like toString
2020-08-30 12:48:28 -05:00
Thomas Weber 1ffdc1a2a4 js: Improve variable type analysis
Redundant type casts are now removed.
2020-08-30 12:39:59 -05:00
Thomas Weber 2d7579d6b2 js: Allow the new frame to inherit values from the old frame, if enabled. 2020-08-30 12:39:10 -05:00
Thomas Weber 38f325e73f js: Store the last value a variable was set to for use in analysis 2020-08-30 12:25:23 -05:00
Thomas Weber 14c04ad947 js: Cleanup descendVariable 2020-08-30 12:21:38 -05:00