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

getting "Uncaught Unsupported operation: Cannot find class for: Closure:350" when running compiled Javascript with dart2js 1.2 #17728

Closed
DartBot opened this issue Mar 24, 2014 · 3 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-dart2js

Comments

@DartBot
Copy link

DartBot commented Mar 24, 2014

This issue was originally filed by @snitko


I decided to create a new issue since the previous one was closed (https://code.google.com/p/dart/issues/detail?id=16244). Although in the previous issue it was said that it was fixed in the 1.2 release, it is not and I still have the following problem when trying to run compiled code. Here's the relevant part of the Dart source code:

List findSubclasses(name) {
  final ms = currentMirrorSystem();
  List subclasses = [];
  ms.libraries.forEach((k,lib) {
    lib.declarations.forEach((k2, c) {
      if(c is ClassMirror && c.superclass != null) {
        final parentClassName = MirrorSystem.getName(c.superclass.simpleName);
        if (parentClassName == name) {
          subclasses.add(c);
        }
      }
    });
  });
  return subclasses;
}

After compiling to Javascript with dart2js (v 1.2), I'm starting to get the following error:

Uncaught Unsupported operation: Cannot find class for: Closure:350 js_helper.dart:1058
wrapExceptionjs_helper.dart:1058
reflectClassByNamejs_mirrors.dart:550
reflectClassByMangledNamejs_mirrors.dart:520
JsClassMirror.get$superclassjs_mirrors.dart:1474
findSubclasses__closure.call$2find_subclasses.dart:10
_LinkedHashMap.forEach$1.H.computeSignature.funccollection_patch.dart:654
J.forEach$1$axbtc_trader.js:82924
UnmodifiableMapView.forEach$1.H.computeSignature.funcjs_mirrors.dart:2376
J.forEach$1$axbtc_trader.js:82924
findSubclasses_closure.call$2find_subclasses.dart:9
_LinkedHashMap.forEach$1.H.computeSignature.funccollection_patch.dart:654
J.forEach$1$axbtc_trader.js:82924
UnmodifiableMapView.forEach$1.H.computeSignature.funcjs_mirrors.dart:2376
J.forEach$1$axbtc_trader.js:82924
findSubclassesfind_subclasses.dart:8
(anonymous function)template.dart:16
prototype.(anonymous function)btc_trader.js:96298
Template.Template$1template.dart:45
Template.static.Template$js_helper.dart:1667
TemplateStack_collect_closure.call$1template_stack.dart:9
ListMixin.forEach$1.H.computeSignature.funclist.dart:55
J.forEach$1$axbtc_trader.js:82924
TemplateStack.static.TemplateStack_collecttemplate_stack.dart:8
maincomponent_temple.dart:21
_IsolateContext.eval$1isolate_helper.dart:247
startRootIsolateisolate_helper.dart:67
(anonymous function)btc_trader.js:96069
init.currentScriptbtc_trader.js:96049
(anonymous function)

The line that the output complains is this one (it is from the code above):

    if(c is ClassMirror && c.superclass != null) {

I guess something's not working quite well with compiling mirrors functionality here.

@floitschG
Copy link
Contributor

Set owner to @floitschG.
Added Area-Dart2JS, Accepted labels.

@floitschG
Copy link
Contributor

The fix didn't make it into v1.2.
The first release including it was v1.3.0-dev.1.0

Could you please try with the latest dev-channel release (or wait a few weeks for the next stable).


Added NeedsInfo label.

@floitschG
Copy link
Contributor

Added AssumedStale label.

@DartBot DartBot added Type-Defect web-dart2js closed-obsolete Closed as the reported issue is no longer relevant labels Mar 17, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants