-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockFactory: Replace eval() with JS-Interpreter #1269
Comments
Would this mean for example you could eventually run the blocks "live" and therefore highlight the current block as you step through the code? |
In context of BlockFactory this just means providing a bit of protection if you load someone else's blocks. The JS-Interpreter can be used to do block highlighting in apps that use Blockly, and this is how it's used in Blockly Games. |
Ah ok missed the block factory part. Got excited with ideas - thanks for clearing that up. |
@starfishmod Stay excited! Check out this demo of the stepping behavior you suggested: https://blockly-demo.appspot.com/static/demos/interpreter/step-execution.html |
That's awesome and exactly what I was thinking about - It's like having a
built in debugger :) Actually I wonder if you could add breakpoints and
then step through the code? :)
Great work! I'm going to have a play with this tonight
…On 15 August 2017 at 03:26, Andrew n marshall ***@***.***> wrote:
@starfishmod <https://github.com/starfishmod> Stay excited. Check out
this demo of the stepping behavior you suggested:
https://blockly-demo.appspot.com/static/demos/interpreter/
step-execution.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1269 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAs6k6zMzYEYeHjUcpNq6wVy_mFk8KE6ks5sYINHgaJpZM4OxUQH>
.
--
Regards
Andrew
|
BlockFactory supports inputting JavaScript block definitions into the UI via the "Manual JavaScript" setting, but currently the code is
eval()
ed to realize the preview block. Replace the raweval()
usage with JS-Interpreter to avoid running arbitrary code in the context of the rest of BlockFactory.PR #1235 only enables the "Manual JavaScript" option when running in a
file://
URL context.The text was updated successfully, but these errors were encountered: