Thomas Weber
ffeb3a9cca
Write some tests
...
tw-unsafe-equals.sb3 is based on a project by https://scratch.mit.edu/users/ContourLines/
tw-zombie-cube-escape-284516654 is based on https://scratch.mit.edu/projects/284516654/ by griffpatch
2020-10-16 19:22:09 -05:00
Thomas Weber
e009f909df
js: Fix ConstantInput.asNumber for constants like "010"
2020-10-16 19:19:21 -05:00
Thomas Weber
fe73344ea7
Fail tests if threads could not be compiled for an unexpected reason
2020-10-16 18:56:40 -05:00
Thomas Weber
565386d03d
Test .sb3 files
2020-10-16 18:50:43 -05:00
Thomas Weber
6a8adacb8d
Refactor compilation result caching
...
Making it less archaic
I mean, giving Object, null, and undefined each different meaning was a bit... questionable
2020-10-16 18:50:22 -05:00
Thomas Weber
7dfd1a9a86
Simplify logging of compiled scripts
2020-10-16 18:41:39 -05:00
Thomas Weber
f28215cf13
Update README
...
Not really proofread, hopefully comprehendable.
2020-10-16 18:15:43 -05:00
Thomas Weber
7263e00d0a
js: Access runtime directly instead of through the Thread
2020-10-16 16:58:33 -05:00
Thomas Weber
c989820042
Fix distance to mouse pointer
2020-10-16 16:34:27 -05:00
Thomas Weber
b5a0fe3cf4
Call directly into IO devices ( #27 )
...
ioQuery helper was pure overhead
2020-10-16 16:14:20 -05:00
Thomas Weber
6f346977d2
Merge branch 'develop' of https://github.com/llk/scratch-vm into develop
2020-10-16 15:04:12 -05:00
Ray Schamp
e1f74678ad
Merge pull request #2621 from LLK/hotfix/enable-hotfixing
...
add hotfix capability to .travis.yml
2020-10-16 08:16:22 -04:00
Thomas Weber
3e528620b0
js: compatibility layer inputs need to use asSafe
2020-10-15 18:54:41 -05:00
Thomas Weber
544c08624e
js: Document each TYPE_NUMBER_NAN input
2020-10-14 23:21:23 -05:00
Thomas Weber
63f9da7797
js: op.multiply should be TYPE_NUMBER_NAN
...
0 * Infinity === NaN
2020-10-14 22:59:44 -05:00
Thomas Weber
bcffb48de3
Populate procedure cache when generating AST
2020-10-14 10:50:21 -05:00
Thomas Weber
a178960853
Add Blocks.populateProcedureCache
2020-10-14 10:46:36 -05:00
Thomas Weber
650eb92060
Precompile should not reset all caches
2020-10-14 10:29:26 -05:00
Thomas Weber
2483852143
Optimize isNameOfCostumeOrSound
2020-10-14 10:27:43 -05:00
Thomas Weber
32d0c44666
Fix style issue
2020-10-14 10:27:34 -05:00
Thomas Weber
922df540d1
Add Runtime.precompile
2020-10-14 10:27:17 -05:00
Thomas Weber
3a03de419f
Replace SafeConstantInput with asSafe
...
Add a new type cast called "asSafe"
This is similar to asUnknown in that the desired return type is not important, but it asks the input to not do any type conversions that would be unsafe if the value is used unprocessed.
For example, setting a variable is something that uses an unprocessed value.
An equality operator, however, returns a processed value, and thus does not need asSafe
2020-10-13 20:18:49 -05:00
Thomas Weber
8712e1c78e
js: optimize list.get for last item of list
2020-10-09 22:51:14 -05:00
Christopher Willis-Ford
c73c4cc5af
Adjust condition for release stage
2020-10-09 14:26:16 -07:00
Christopher Willis-Ford
30ee756fc7
add hotfix capability to .travis.yml
2020-10-09 13:46:35 -07:00
Thomas Weber
1349c13988
Name the emitFast function
...
This gives it a proper name in the profiler.
2020-10-07 12:46:34 -05:00
Thomas Weber
e42dd87253
Restore THREAD_STEP_INTERVAL and THREAD_STEP_INTERVAL_COMPATIBILITY
...
Some of the tests expect these to exist, so bring them back.
The runtime itself does not use these values.
2020-10-05 15:49:56 -05:00
Thomas Weber
d002f1394b
Replace "compatibility mode" with "framerate" ( #23 )
2020-10-05 15:12:36 -05:00
Thomas Weber
50bb8c3dbe
js: Remove unsafe op.equals optimization
...
Fixes https://llk.github.io/scratch-gui/master/#429509588
I believe this optimization broke ops like "<operation = 00000101 ?>"
2020-09-29 13:51:49 -05:00
Thomas Weber
b9518614a6
js: Reset VariableInput._value when set to VariableInput without a value
...
This should be fix some subtle bugs.
2020-09-26 22:52:57 -05:00
Thomas Weber
756ecdd1c0
js: Rename pen constants
2020-09-26 22:50:16 -05:00
Thomas Weber
4edc60397f
js: SafeConstantInput implements Input
2020-09-26 19:25:05 -05:00
Thomas Weber
4816677b55
Fix some edge cases with stage caching
2020-09-26 17:49:53 -05:00
Thomas Weber
c635a8aa96
js: use ** for exponentiation
...
Slight performance boost as browsers are able to optimize this better than Math functions.
2020-09-26 17:41:37 -05:00
Thomas Weber
cf6da4743e
js: use more descriptive script names
2020-09-26 17:30:18 -05:00
Thomas Weber
8c9d9efbb3
js: Optimize list.delete for 1 and last
2020-09-26 17:16:46 -05:00
Thomas Weber
30886b3ba6
Cache stage target
...
This is a pretty minor optimization.
The stage target was almost always the first target in the list anyways.
2020-09-26 17:06:35 -05:00
Thomas Weber
d864a0a13a
Merge branch 'develop' of https://github.com/llk/scratch-vm into develop
2020-09-25 14:10:14 -05:00
DD Liu
7eabcb8a29
Merge pull request #2329 from adroitwhiz/remove-updatedrawableproperties
...
Remove remaining updateDrawableProperties calls
2020-09-24 15:50:26 -04:00
Thomas Weber
01c8ecd41c
js: Fix playing sounds named "1", "2", etc.
2020-09-19 18:33:39 -05:00
Thomas Weber
8ffe35b05f
Fix setCompilerOptions
2020-09-19 14:36:25 -05:00
Thomas Weber
cae6f712c3
Fix test failures
2020-09-19 14:05:56 -05:00
Thomas Weber
d889dea44d
Stuck Checking -> Warp Timer & simplify compiler options
2020-09-19 13:45:05 -05:00
Thomas Weber
1db0328516
Revert "js: Use bitwise | 0 for op.floor"
...
This reverts commit 62f55e7f50 .
2020-09-19 10:59:11 -05:00
Thomas Weber
eb28f8b497
js: Reset variable inputs before control.for
2020-09-18 14:35:49 -05:00
Thomas Weber
87cd56d6fe
js: Reset variable inputs before descending into control.waitUntil and control.while
2020-09-18 14:32:40 -05:00
Thomas Weber
2e666194df
js: Refactor variable input resetting
2020-09-18 14:31:29 -05:00
Thomas Weber
90ad5b1d3e
ast+js: Add a secret debugger block
2020-09-18 14:30:50 -05:00
Thomas Weber
62f55e7f50
js: Use bitwise | 0 for op.floor
2020-09-17 19:09:10 -05:00
Thomas Weber
fe08862d32
Add missing compiler comment
2020-09-17 19:06:43 -05:00