Commit Graph
843 Commits
Author SHA1 Message Date
Paul Kaplan 34dfbb50ba Update naming and implementation for custom procedure blocks 2017-11-16 14:17:08 -05:00
Paul Kaplan 16ca994818 Allow ask to use say bubble via events 2017-11-08 11:12:12 -05:00
Andrew Sliwinski 3fa1599b90 Merge pull request #701 from Scimonster/variable-xml-names
Correctly deserialize HTML entities in block DOM
2017-11-08 08:03:56 -05:00
Eric Rosenbaum 50c646259c Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/extension-music 2017-11-07 15:54:38 -05:00
Eric Rosenbaum 112bb55b9b JSDoc 2017-11-07 15:21:47 -05:00
Eric Rosenbaum 9bd48e8761 Mark the buildMenu function private 2017-11-07 15:21:20 -05:00
Ray Schamp b07bbd4745 Merge pull request #765 from mzgoddard/execute-is-promise-deopt
Write src/engine/execute so it can be optimized
2017-11-07 12:19:58 -05:00
Ray Schamp 180e545b4e Merge pull request #766 from mzgoddard/execute-handle-report-block-utility
Extract handleReport and BlockUtility from inside the execute function
2017-11-07 12:19:23 -05:00
Eric Rosenbaum 87cf546b03 Remove music opcodes from sound bocks 2017-11-07 11:28:04 -05:00
Eric Rosenbaum 533ed60d98 Update sb2 specmap with music extension blocks 2017-11-07 11:27:50 -05:00
Eric Rosenbaum b2941f8c5a Load music as internal extension 2017-11-07 11:27:33 -05:00
Paul Kaplan 1f98960636 Merge pull request #764 from paulkaplan/ask-answer-events
Ask/answer opcode implementation with runtime events.
2017-11-07 10:49:48 -05:00
Ray Schamp 5290570fc5 Merge pull request #758 from mzgoddard/done-threads-indexof
Constant time check if a thread is in doneThreads
2017-11-07 10:30:15 -05:00
Michael "Z" Goddard e3dfe24d7f Store references to target in say blocks
As part of reusing the block utility object, asynchronous say block
functions cannot use the utility in a promise or timeout asynchronous
handle. Store the needed target reference so utility is not needed
later.
2017-11-07 10:21:52 -05:00
Michael "Z" Goddard bbe7981703 Extract blockUtility from execute to reduce allocations
blockUtility as an object literal inside execute creates 11 objects,
one for the object, and 10 for the function closures. As a separate
object and allocated once, setting its sequencer and thread members,
block functions can share the same util object. Extract blockUtility to
cut down on allocations.
2017-11-07 10:21:51 -05:00
Michael "Z" Goddard 78847de660 Extract handleReport and add arguments to prevent closure alloc
`handleReport` inside `src/engine/execute.js`'s `execute` method needs
to allocate a closure to be able to refer to the higher scoped
variables. `execute` is called frequently that this has a noticable
impact on memory allocation and later collection. Extract handleReport
and add arguments to prevent the allocation.
2017-11-07 10:21:51 -05:00
Andrew Sliwinski 1efc312c36 Merge pull request #767 from mzgoddard/docs-blocks-param-names
Replace duplicate documentation on getProcedureParamNames
2017-11-06 19:34:51 -05:00
Michael "Z" Goddard 888da915a5 Replace duplicate documentation on getProcedureParamNames
Replace the duplicate getProcedureDefintion documentation block above
getProcedureParamNames.
2017-11-06 17:28:34 -05:00
Eric Rosenbaum fbeb1de1c1 Add music extension file 2017-11-06 16:57:16 -05:00
Michael "Z" Goddard cd9004ce5b Write src/engine/execute so it can be optimized
Testing with implicitly casted `value` and `value.then` is deoptimizing
isPromise, which deoptimizes execute. In this case deoptimizing means
that the JavaScript VM cannot compile the functions into a form that
can be run faster.
2017-11-06 15:54:22 -05:00
Paul Kaplan 73ffc6a797 Ask/answer opcode implementation with runtime events. 2017-11-06 15:08:15 -05:00
Eric Rosenbaum a735459427 Merge pull request #762 from ericrosenbaum/bugfix/wedo-tilt-reporter-shape
Fix shape of boolean tilt reporter
2017-11-06 11:21:12 -05:00
Eric Rosenbaum 59e0c75abf Fix shape of boolean tilt reporter 2017-11-06 10:17:53 -05:00
Eric Rosenbaum 323fde3859 Appease the linter 2017-11-06 10:10:41 -05:00
Eric Rosenbaum cc35bcc791 Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/wedo-block-icon 2017-11-06 10:02:57 -05:00
Eric Rosenbaum 0540640684 Merge pull request #754 from ericrosenbaum/feature/pen-block-icon
Extension block icons (including pen icon)
2017-11-06 10:02:23 -05:00
Eric Rosenbaum 14087ef24f Add wedo block icon 2017-11-06 10:00:13 -05:00
Paul Kaplan caa9b97520 Fix linting 2017-11-04 10:10:17 -04:00
Paul Kaplan 8616390fab Add back pen transparency from color number 2017-11-03 21:24:47 -04:00
Michael "Z" Goddard 6d82c0f115 In place filter threads at end of stepThreads
Skip a large array allocation by filtering done threads in place with a
for loop.
2017-11-03 17:48:52 -04:00
Michael "Z" Goddard 4e24a3f380 Constant time check if thread is in doneThreads
Remove indexOf tests for thread existence in doneThreads. Maintain a
list of null and thread objects mirroring the index position of threads
that are done in runtime.threads. Filter out null values after
filtering out done threads from runtime.threads.

This has a small side effect that threads that normally became DONE and
were added to doneThreads before being removed or restarted will not be
in doneThreads in this version. Restarted threads (_restartThread) do
not appear in this version but new copies will be in Runtime
this.threads supporting glow and monitor updates. Removed threads
(_removeThread) do not appear in this version if they are removed after
they were seen as DONE by the prior version. Threads removed before
they are seen as DONE do not appear in doneThreads in the prior or this
version.

Threads that are removed before normally becoming DONE do not appear in
doneThreads in either case. Threads that are restarted before the loop
checks if the thread is done do not appear in doneThreads in either
case.
2017-11-03 17:46:50 -04:00
Chris Willis-Ford ef961c5a4b Merge pull request #756 from cwillisf/autoload-extensions
Autoload extensions
2017-11-03 13:59:01 -07:00
Christopher Willis-Ford 0ad03f8d70 Actually finish SB2 specMap for WeDo 2.0
Apparently I took a break at the wrong time and forgot to come back to
this... :/
2017-11-03 13:48:05 -07:00
Christopher Willis-Ford 51dcfb954d Pen integration test: don't pre-load pen extension 2017-11-03 12:50:37 -07:00
Christopher Willis-Ford c88a8fa55a Fix tests & a typo 2017-11-03 11:42:20 -07:00
Christopher Willis-Ford 0af3de9bf0 Load extensions when loading a project or sprite
- Accumulate extension info while deserializing JSON
- Install extensions (if any) before installing target(s)
- Merged 'install' steps of the "add sprite" and "load project" paths
2017-11-03 11:20:24 -07:00
Paul Kaplan c1ba902ebb Use category info that has colors when building menu blocks 2017-11-03 13:50:50 -04:00
Eric Rosenbaum 2ac464c53e Prepend icon to each extension block 2017-11-03 11:35:42 -04:00
Eric Rosenbaum a115d47bb8 Add block icon svg as single-line data URI 2017-11-03 11:25:39 -04:00
Paul Kaplan e2ac6947af Merge pull request #753 from paulkaplan/provide-argument-ids
Provide argument id list with callers and procdef blocks
2017-11-03 09:48:37 -04:00
Paul Kaplan 007fe2ed53 Fix linting 2017-11-02 17:14:00 -04:00
Paul Kaplan 5b9d4ae23e Provide argument id list with callers and procdef blocks 2017-11-02 17:03:12 -04:00
Paul Kaplan c5d3e2dbb4 Merge pull request #746 from paulkaplan/fix-variable-of
Search for variables by name in "of" block
2017-11-02 11:09:42 -04:00
Chris Willis-Ford 91420375d5 Merge pull request #724 from cwillisf/no-dupe-extensions
Prevent duplicate extensions
2017-11-01 21:29:00 -07:00
Paul Kaplan 2c3c9f9ac8 Search for variables by name in "of" block 2017-11-01 14:31:52 -04:00
Paul Kaplan 18398d010b Add hideFromPalette flag for hiding legacy blocks 2017-11-01 11:30:15 -04:00
Paul Kaplan 082e051cce Support legacy pen block op codes 2017-11-01 11:30:15 -04:00
Christopher Willis-Ford 8bb48e2a53 Add built-in extension "URL" to _loadedExtensions
Dupe prevention works better when you actually record the necessary
info...
2017-10-31 13:00:19 -07:00
Christopher Willis-Ford ae878b2050 Simplify extension duplication prevention station
Since we will only have builtin extensions for a while, the
more-complicated, watchdog-based extension duplication prevention has
been replaced with one that treats the extension URL as equivalent to
the extension ID. This is true only for built-in extensions, so once we
start supporting third-party extensions we will likely need to bring
back the watchdog (commit e4381b4693) and
the more-complex duplication prevention (commit
670e51d335).

The code here should be treated as a last resort: ideally the GUI should
check if a particular extension is loaded (maybe by calling the
Extension Manager's new `isExtensionLoaded` method) and avoid calling
`loadExtensionURL` if it is.
2017-10-31 12:35:18 -07:00
Christopher Willis-Ford 670e51d335 Refuse to register second extension with same ID
If an extension attempts to register with the same ID as another
extension which has already registered, the new registration is refused.
If the extension is in a worker and no other extension is successfully
registered by that worker, the watchdog system will terminate the
"empty" worker.
2017-10-31 12:24:26 -07:00