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

html: dartium: exceptions are not wrapped #2901

Closed
rakudrama opened this issue May 4, 2012 · 2 comments
Closed

html: dartium: exceptions are not wrapped #2901

rakudrama opened this issue May 4, 2012 · 2 comments
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable

Comments

@rakudrama
Copy link
Member

tests/html/indexeddb_3_test fails because it expects an exception of type IDBDatabaseException.

Due to the lack of re-export (bug 760), most of the dom types are wrapped to give functionally equivalent html types. Some of the DOM types are thrown. This means every method needs to be wrapped in a try-catch to ensure wrapping.

I hope 760 is resolved and implemented soon so we don't have to implement the following:

Example:

  List<String> get objectStoreNames() => _wrap(_ptr.objectStoreNames);

  void deleteObjectStore(String name) {
    _ptr.deleteObjectStore(_unwrap(name));
    return;
  }

Will have to become

  List<String> get objectStoreNames() {
    try {
      return _wrap(_ptr.objectStoreNames);
    } catch (var e) {
      if (e is _DOMTypeBase) throw _wrap(e);
      throw;
    }
  }

  void deleteObjectStore(String name) {
    try {
      _ptr.deleteObjectStore(_unwrap(name));
      return;
    } catch (var e) {
      if (e is _DOMTypeBase) throw _wrap(e);
      throw;
    }
  }

I guess we could write helpers that took closures - that would shrink the code size at the expense of adding a closure allocation to every dom call:

  List<String> get objectStoreNames() => _wrap_value_and_exceptions(() => _ptr.objectStoreNames);

@rakudrama
Copy link
Member Author

Marked this as being blocked by #3070, #3071, #3081, #3082, #3083.

@vsmenon
Copy link
Member

vsmenon commented Jul 16, 2012

Invalid now that dart:html is not wrapping dart:dom.


Added Invalid label.
Marked this as being blocked by #760, #3070, #3071, #3081, #3082, #3083.
Unmarked this as being blocked by #760, #3070, #3071, #3081, #3082, #3083.

@rakudrama rakudrama added Type-Defect closed-invalid Closed as we don't believe the reported issue is generally actionable labels Jul 16, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable
Projects
None yet
Development

No branches or pull requests

2 participants