-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DDC - DataTransferItem.getAsEntry returns 'NativeJavaScriptObject' instead of 'Entry' #35510
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
Comments
cc @jmesserly - related to JS interop difference between dart2js and ddc? |
yeah, DDC does stricter checks right now, my proposal is to relax them to match dart2js (and relax both compilers when it comes to generics). |
I think when we hit this, @terrylucas typically adds a call to |
Yep Looks like known problem that I've fixed in the past with registerExtension. In this case type DataTransferItem needs registerExtension. |
Okay I've tried to repro this and I'm unable to. What version of Chrome were you using? I'm using Version 71.0.3578.98 (Official Build) (64-bit) on Linux. I've tried drag/drop of resources (e.g., images, etc) as well as files and directories being dropped to my dropArea. All work, if directory get a DirectoryReader to iterate over all files in the directory. Look at my _onFilesDrop function. I'm able to get an Entry, File, FileEntry, and DirectoryEntry all seem to work.
I'm wondering if Chrome has changed what it returns? Here's my _onFilesDrop event listener:
I've zipped up my *.html and *.dart file for testing drag/drop. |
I just tried again with a bare project and got the same error. I also tried with terrylucas' code with the same error. I've attached the files I tested with.
Log from terrylucas' code:
|
Forgot to add, I tried dropping a file and a folder, neither works. |
Okay, I'm finally able to repro. My DDC wasn't building and running. |
Have a fix CL pending - a bunch of applyExtensions (more than I thought). But works now in both dart2js and DDC. |
When compiled with web serve, it throws an exception that says "Type 'NativeJavaScriptObject' is not a subtype of expected type 'Entry'."
When compiled with dart2js it works as expected.
Here's a sample of the code i'm using:
The text was updated successfully, but these errors were encountered: