-
Notifications
You must be signed in to change notification settings - Fork 38
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
all methods from InternalUtils should be implemented by JsObject #5
Comments
JsObject is part of Elemental and is totally generated based on his definition in the extern file. We don't plan to add any other utility methods on generated code. |
I didn't understand this one. What is InternalUtils? |
The problem is that JsInterop cannot generate |
What's wrong with |
@tbroyer I did not notice because it is not in my version of
I guess it is ok for library code or code generation, but not sure this is what you want to expose to users.
is far clearer than
|
BTW, you wouldn't expose any of that to users. You'd wrap this in a library and/or use JsInterop. @JsProperty(name="clipboardData", namespace="window")
static native Object getClipboardData();
@JsProperty(name="clipboard", namespace="navigator")
static native Object getNavigatorClipboard();
@JsProperty(name="execCommand", namespace="document")
static native Object getDocumentExecCommand(); (you could use a if (getClipboardData() != null) {
// clipboardData.setData
} else if (getNavigatorClipboard() != null) {
// new Clipboard API, write()
} else if (getDocumentExecCommand() != null) {
// create hidden text area, select text, execCommand
} else {
// WTF?
} |
It is
not
On the longer run, we are also considering having a solution for feature-checking that is auto-generated by elemental. |
Is there a reason JsObject does not have all the methods currently hidden in
InternalUtils
? Adding them would be trivial, for example:This change would also make
JsPropertyMap
redundant.At the very least InternalUtils should be renamed and made public, but I think it would be more natural to invoke the methods on the object itself rather than calling static methods in a utility class
The text was updated successfully, but these errors were encountered: