-
Notifications
You must be signed in to change notification settings - Fork 22
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
Value of this is window #27
Comments
Thanks for the report! You're, right, Pretty sure it's got to do with how we use |
@asg017 I can look into this later too if you need a hand! |
I see in your example in readme file is wrong -> new Interpreter({module: module, observer: observer}). This Interpreter are much more flexible and functionality. However i just wonder how to deal with built in variables i.e. md, html etc. I mean how to delete or change existing one using this Interpreter? |
Hey @Srabutdotcom , for changing which builtin cells are used in your implementation, that's the job of the runtime, not the interpreter. The interpreter takes in a runtime module as an input, where that module already has the builtin cells included. Using this example from the runtime readme, you can do something like: const runtime = new Runtime({color: "red"}); This creates a new runtime with different builtin cells (in this case, a cell called const main = runtime.module();
const interpret = new Interpreter();
const observer = () => true
await interpret.cell(" example = `The value of color is ${color}` ", main, observer);
await main.value("example") // "The value of color is red" Also, feel free to ask more questions in #29 , which is about the new Interpreter/Compiler API, or create a new issue (since this issue is about another problem) |
Hai @asg017 , Sorry, i mean standard library. lets for example we have 3 md in 3 different cells. how do we change or update |
@Srabutdotcom please file a new issue with details on what youre trying to do, and whatever code you have. Also see #29 for example of the new Interpreter. |
when defining a cell, the value of 'this' is set as window, while for the compiled output of the same code it will be undefined by default.
The text was updated successfully, but these errors were encountered: