-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
dart:dom indexeddb idbcursorwithvalue does not have continueFunction method #1814
Comments
Apologies, it does extend _IDBCursorJs However, the error I get from running a simple app is: Uncaught TypeError: Object #<IDBCursorWithValue> has no method 'continueFunction' |
Changed the title to: "dart:dom indexeddb idbcursorwithvalue does not have continueFunction method". |
Sample IndexedDB code (this encounters the error): https://gist.github.com/1889118 displayItems(dom.IDBDatabase db) { |
Here is the compiled JavaScript code (from the nightly Frog) cursorRequest.addEventListener("success", $wrap_call$1((function (e) { You can the continueFunction isn't being translated to .continue() |
This is my favourite function! The wrapperless implementations are dropping the renaming of this special case on the floor. In the wrapping dom we had to generate cursor['continue'] since some JS implementations think that continue is a keyword. Several things need to line up to get this to work. It is made more tricky because of the optional argument. Option (1) is (1a) to implement 'renaming' i.e. teach Frog that lone identifiers in native strings are the real name void continueFunction([_IDBKeyJs key = null]) native 'continue'; (1b) teach Frog that some names need to be quoted and put in array syntax Option (2) is to cruft up the generator with a table of a dozen or so native strings as replacements to the default action. We would generate void continueFunction([_IDBKeyJs key = null]) native ''' I want to look more into option (1) since the compiler has much more information and the feature has other uses. |
This comment was originally written by ngeoffray@google.com Stephen, I think I'd favor option 2 to go with frog, but we definitely need something different for leg. I think generating something like (that could even be a helper); The compiler will have enough information to optimize that. WDYT? |
Sounds like option 2 is under our control, and could get us over the hump. I'm concerned that option 1 would take too long. |
Looks like the new changes aren't being copied into the SDK's lib directory. I still see: void continueFunction([_IDBKeyJs key = null]) native; in ~/Code/Dart-git/dart/xcodebuild/Release_ia32/dart-sdk/lib/ However, when I deleted the Release_ia32/dart-sdk directory, and rebuilt with ./tools/build.py -m release and rebuilt, I saw the changes. I think this is a separate bug for build process. |
Slight issue, if you have the following line of code: dom.IDBCursorWithValue cursor = ... then the JavaScript is still cursor.continueFunction() If you write: var cursor = ... you will get: cursor.continueFunction$0(); (which is correct) Shouldn't IDBCursorWithValue work, as it extends IDBCursor? |
BTW, success! [once I deleted and rebuilt my SDK and changed to IDBCursor] Thanks! |
Does the code from the first example in comment #9 run? |
Yes, it does, thanks Stephen. Both 'var cursor' and 'dom.IDBCursorWithValue cursor' work. This is great, thanks! I think we can close this. |
Fixed. Code on github compiles and runs in unchecked mode. Added Fixed label. |
Revisions updated by `dart tools/rev_sdk_deps.dart`. intl (https://github.com/dart-lang/intl/compare/a127902..881e53e): 881e53e Fri Dec 9 08:01:26 2022 -0800 Copybara-Service Merge pull request #346 from lukepighetti:patch-1 e5ca40d Fri Dec 9 07:00:14 2022 -0800 Copybara-Service Merge pull request #453 from selcukguvel:doc-fix edbfc06 Fri Dec 9 15:34:30 2022 +0100 Moritz Merge branch 'master' into patch-1 b489fdd Fri Dec 9 15:30:23 2022 +0100 Moritz Merge branch 'master' into doc-fix 60a0d8c Fri Dec 9 04:17:04 2022 -0800 Googler Internal change ef953fd Mon Mar 7 16:30:31 2022 +0300 selcukguvel Fix NumberFormat document readability issue - Show "var eurosInUSFormat = .." on a new line aa98b67 Tue Dec 29 15:31:53 2020 -0500 Luke Pighetti Remove 7 year old unimplemented fields test (https://github.com/dart-lang/test/compare/73cd754..09fb067): 09fb0679 Thu Dec 8 14:52:33 2022 -0800 Jacob MacDonald prep packages for publishing (#1814) c8ac4382 Thu Dec 8 14:07:05 2022 -0800 Jacob MacDonald Prepare for Dart 3.0 api removals (#1812) Change-Id: I9a7caed3165d3b65e96001aa029602a09355bce8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274542 Auto-Submit: Michael Thomsen <mit@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
This is an unfortunate blocker.
IDBCursorWithValue (specified http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursorWithValue) should extend IDBCursor.
The current dart:dom implementation does NOT extend IDBCursor, and therefore does NOT allow a user to call continueFunction()
The text was updated successfully, but these errors were encountered: