{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/26322","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/26322/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/26322/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/26322/events","html_url":"https://github.com/dart-lang/sdk/issues/26322","id":150587176,"number":26322,"title":"dart2js with package js crash","user":{"login":"sircco","id":10447026,"avatar_url":"https://avatars.githubusercontent.com/u/10447026?v=3","gravatar_id":"","url":"https://api.github.com/users/sircco","html_url":"https://github.com/sircco","followers_url":"https://api.github.com/users/sircco/followers","following_url":"https://api.github.com/users/sircco/following{/other_user}","gists_url":"https://api.github.com/users/sircco/gists{/gist_id}","starred_url":"https://api.github.com/users/sircco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sircco/subscriptions","organizations_url":"https://api.github.com/users/sircco/orgs","repos_url":"https://api.github.com/users/sircco/repos","events_url":"https://api.github.com/users/sircco/events{/privacy}","received_events_url":"https://api.github.com/users/sircco/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-dart2js","name":"area-dart2js","color":"c7def8"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/area-js_interop","name":"area-js_interop","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-23T19:17:16Z","updated_at":"2016-04-26T19:23:49Z","closed_at":"2016-04-26T19:23:49Z","body":"```\r\nimport 'package:js/js.dart';\r\n\r\nmain() {\r\n        foo = allowInterop(() {\r\n                        print(\"nja nja naj\");\r\n                        }\r\n                );\r\n}\r\n\r\n@JS\r\n        external set foo(Function f);\r\n\r\n\r\n```\r\n\r\na@LinL460:/tmp/jstest/web$ dart2js main.dart -o main.dart.js \r\nmain.dart:12:2:\r\nError: A metadata annotation must be either a reference to a compile-time constant variable or a call to a constant constructor.\r\nTry using a different constant value or referencing it through a constant variable.\r\n@JS\r\n ^^\r\nmain.dart:12:1:\r\nInternal Error: Invalid @JS(...) annotation.\r\n@JS\r\n^^^\r\nThe compiler is broken.\r\n\r\nWhen compiling the above element, the compiler crashed. It is not\r\npossible to tell if this is caused by a problem in your program or\r\nnot. Regardless, the compiler should not crash.\r\n\r\nThe Dart team would greatly appreciate if you would take a moment to\r\nreport this problem at http://dartbug.com/new.\r\n\r\nPlease include the following information:\r\n\r\n* the name and version of your operating system,\r\n\r\nUbuntu 16.04\r\n\r\n* the Dart SDK build number (1.15.0), and\r\n\r\n1.15.0\r\n\r\n* the entire message you see here (including the full stack trace\r\n  below as well as the source location above).\r\n\r\nThe compiler crashed: Internal Error: Invalid @JS(...) annotation.\r\n#0      _CompilerDiagnosticReporter.internalError (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1963)\r\n#1      JsInteropAnnotationHandler.validate (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/patch_parser.dart:514)\r\n#2      EagerAnnotationHandler.checkAnnotation.<anonymous closure> (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/patch_parser.dart:431)\r\n#3      _CompilerDiagnosticReporter.withCurrentElement (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1753)\r\n#4      ResolutionEnqueuer.emptyDeferredTaskQueue (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/enqueue.dart:885)\r\n#5      ResolutionEnqueuer.onQueueEmpty (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/enqueue.dart:878)\r\n#6      Enqueuer.forEach (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/enqueue.dart:708)\r\n#7      Compiler.emptyQueue (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1117)\r\n#8      Compiler.processQueue (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1145)\r\n#9      Compiler.compileLoadedLibraries (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1013)\r\n#10     Compiler.runInternal.<anonymous closure> (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:884)\r\n#11     _RootZone.runUnary (dart:async/zone.dart:1137)\r\n#12     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:551)\r\n#13     _Future._propagateToListeners (dart:async/future_impl.dart:637)\r\n#14     _Future._completeWithValue (dart:async/future_impl.dart:424)\r\n#15     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:479)\r\n#16     _microtaskLoop (dart:async/schedule_microtask.dart:41)\r\n#17     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)\r\n#18     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)\r\n#19     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)\r\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/214858116","html_url":"https://github.com/dart-lang/sdk/issues/26322#issuecomment-214858116","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/26322","id":214858116,"user":{"login":"kevmoo","id":17034,"avatar_url":"https://avatars.githubusercontent.com/u/17034?v=3","gravatar_id":"","url":"https://api.github.com/users/kevmoo","html_url":"https://github.com/kevmoo","followers_url":"https://api.github.com/users/kevmoo/followers","following_url":"https://api.github.com/users/kevmoo/following{/other_user}","gists_url":"https://api.github.com/users/kevmoo/gists{/gist_id}","starred_url":"https://api.github.com/users/kevmoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevmoo/subscriptions","organizations_url":"https://api.github.com/users/kevmoo/orgs","repos_url":"https://api.github.com/users/kevmoo/repos","events_url":"https://api.github.com/users/kevmoo/events{/privacy}","received_events_url":"https://api.github.com/users/kevmoo/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T19:23:49Z","updated_at":"2016-04-26T19:23:49Z","body":"Yes! See the changelog for 1.16\r\n\r\nhttps://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#javascript-interop\r\n\r\nSorry you found out this way!"}}