Skip to content
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

Add method for @js macro with base (à la Blink) #32

Open
twavv opened this issue Dec 24, 2019 · 0 comments
Open

Add method for @js macro with base (à la Blink) #32

twavv opened this issue Dec 24, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@twavv
Copy link
Member

twavv commented Dec 24, 2019

Blink defines a method for @js that looks like

@js window console.log("foo")

We should define a base method for here it in this repo and then let other packages (e.g., Blink and WebIO) extend a method that acts on the specific type of the first arg.

# In JSExpr
macro js(target, expr)
    return :(js($(esc(target), ...))
end

# In Blink
function JSExpr.js(w::Window, code::JSString)
    # Evaluate the JS code in the Blink window
end
@twavv twavv added the enhancement New feature or request label Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant