fileSystem.retainEntry() incorrectly passed a callback?
See original GitHub issueThe chrome.fileSystem.retainEntry()
API does not take a callback. I am seeing chromep
fail when calling this method, as Chrome appears to be doing some schema checking. I can’t find anything about where this happens, and I should be able to work around it, but it seems like chromep
should be aware of this.
E.g. consider this code:
var id = chromep.fileSystem.retainEntry(entry);
At this point I would expect id
to be a string. Instead it is a rejected Promise. From the console:
Promise {[[PromiseStatus]]: "rejected",
[[PromiseValue]]: Error: Invocation of form fileSystem.retainEntry(object, function) doesn't match definition fileSystem.retainEntry(object entry)}
Is this expected? Is it something else about my environment that is interfering with things? Or perhaps a bug?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why are my callback functions executing in the wrong order?
It looks like you've misunderstood the idea of callbacks. The idea is that you pass a function as an argument to another function,...
Read more >JavaScript Callbacks Variable Scope Problem - Pluralsight
In this free JavaScript guide, you'll learn how to fix the common JavaScript callbacks variable scope problem. This step-by-step JavaScript ...
Read more >FileSystemFileEntry.file() - Web APIs - MDN Web Docs
A callback function which is called when the File has been created successfully; the File is passed into the callback as the only...
Read more >Callbacks / Callables - Manual - PHP
A PHP function is passed by its name as a string. Any built-in or user-defined function can be used, except language constructs such...
Read more >Don't use functions as callbacks unless they're designed for it
What you are experiencing is the poor design of the JavaScript base library. Whoever designed map() to pass all these extra arguments should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, I will add a warning to the readme tomorrow.
It would be great if this library can be a total replacement of
chrome
, so I will leave this open for now.Unfortunate but seems reasonable, especially with the update to the README. Your example of using
chrome
/chromep
is nice and clean.