{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/25318","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/25318/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/25318/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/25318/events","html_url":"https://github.com/dart-lang/sdk/issues/25318","id":124000320,"number":25318,"title":"js-interop: function binding is working in Chrome, but not in Dartium","user":{"login":"PaulAnnekov","id":1203892,"avatar_url":"https://avatars.githubusercontent.com/u/1203892?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulAnnekov","html_url":"https://github.com/PaulAnnekov","followers_url":"https://api.github.com/users/PaulAnnekov/followers","following_url":"https://api.github.com/users/PaulAnnekov/following{/other_user}","gists_url":"https://api.github.com/users/PaulAnnekov/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulAnnekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulAnnekov/subscriptions","organizations_url":"https://api.github.com/users/PaulAnnekov/orgs","repos_url":"https://api.github.com/users/PaulAnnekov/repos","events_url":"https://api.github.com/users/PaulAnnekov/events{/privacy}","received_events_url":"https://api.github.com/users/PaulAnnekov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jacob314","id":1226812,"avatar_url":"https://avatars.githubusercontent.com/u/1226812?v=3","gravatar_id":"","url":"https://api.github.com/users/jacob314","html_url":"https://github.com/jacob314","followers_url":"https://api.github.com/users/jacob314/followers","following_url":"https://api.github.com/users/jacob314/following{/other_user}","gists_url":"https://api.github.com/users/jacob314/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob314/subscriptions","organizations_url":"https://api.github.com/users/jacob314/orgs","repos_url":"https://api.github.com/users/jacob314/repos","events_url":"https://api.github.com/users/jacob314/events{/privacy}","received_events_url":"https://api.github.com/users/jacob314/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-12-27T23:09:50Z","updated_at":"2015-12-28T19:34:52Z","closed_at":null,"body":"**Describe the issue you're seeing**\r\nI'm porting [Leaflet](http://leafletjs.com/) library to Dart for my own needs.\r\nThe code in [gist](https://gist.github.com/PaulAnnekov/df319b5d58926a196eb5) works fine for Chrome, but not for Dartium. In Dartium I get the following exception:\r\n```\r\nException: TypeError: undefined is not a function \r\nmap package:my/leaflet/leaflet.dart_js_interop_patch.dart:35\r\nmain app.dart:4 \r\n```\r\n\r\nI tried to add `@JS('L')` before `library ...;` and remove direct names of functions in JS annotations from `map`, `latLng` and `tileLayer`. But when I did it, the page stopped working in both browsers %). I start to get the following exception in Chrome:\r\n```\r\nUncaught TypeError: L.tileLayer is not a function\r\ndart.main @ app.dart:5\r\n(anonymous function) @ iterable.dart:275\r\ninit.currentScript @ iterable.dart:275\r\n(anonymous function) @ iterable.dart:275\r\n(anonymous function) @ iterable.dart:275\r\n```\r\n\r\nP.S. Porting procedure is a pain. No docs, ugly stack trace on exceptions...\r\n\r\n**Does it happen in Dartium or when compiled to JavaScript?**\r\nOnly in Dartium\r\n\r\n* Dart SDK version:\r\nDart VM version: `1.13.1 (Thu Dec 17 14:42:19 2015) on \"linux_x64\"`\r\n* pkg/js version: `0.6.0`\r\n\r\n\r\nFailing code: https://gist.github.com/PaulAnnekov/df319b5d58926a196eb5"},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/167635577","html_url":"https://github.com/dart-lang/sdk/issues/25318#issuecomment-167635577","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/25318","id":167635577,"user":{"login":"jacob314","id":1226812,"avatar_url":"https://avatars.githubusercontent.com/u/1226812?v=3","gravatar_id":"","url":"https://api.github.com/users/jacob314","html_url":"https://github.com/jacob314","followers_url":"https://api.github.com/users/jacob314/followers","following_url":"https://api.github.com/users/jacob314/following{/other_user}","gists_url":"https://api.github.com/users/jacob314/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob314/subscriptions","organizations_url":"https://api.github.com/users/jacob314/orgs","repos_url":"https://api.github.com/users/jacob314/repos","events_url":"https://api.github.com/users/jacob314/events{/privacy}","received_events_url":"https://api.github.com/users/jacob314/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T19:34:52Z","updated_at":"2015-12-28T19:34:52Z","body":"When I try to repro I get blocked running pub get. Is the pubspec not\nconfigured correctly or do I need to create a separate leaflet pub package\nin a sibling directory?\n\nResolving dependencies...\nCould not find package leaflet at \"../leaflet.dart\".\nDepended on by:\n- nova_poshta_osm_sync\"\n\nOn Mon, Dec 28, 2015 at 11:24 AM, Paul Annekov <notifications@github.com>\nwrote:\n\n> @jacob314 <https://github.com/jacob314> I have added window.Leaflet = L;\n> to JS code and changed JS('L') to JS('Leaflet') (my leaflet dart api\n> <https://github.com/PaulAnnekov/nova_poshta_osm_sync/blob/master/lib/leaflet/leaflet.dart>).\n> Now everything is working good in Chrome, but it still fails in Dartium:\n>\n> Uncaught Unhandled exception:\n> TypeError: undefined is not a function\n> #0      JsFunction._apply (dart:js:1178)\n> #1      JsFunction.apply (dart:js:1176)\n> #2      map (package:nova_poshta_osm_sync/leaflet/leaflet.dart_js_interop_patch.dart:19:81)\n> #3      main.<main_async_body> (http://localhost:8080/app.dart:167:9)\n> #4      _RootZone.runUnary (dart:async/zone.dart:1149)\n> #5      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:502)\n> #6      _Future._propagateToListeners (dart:async/future_impl.dart:585)\n> #7      _Future._completeWithValue (dart:async/future_impl.dart:376)\n> #8      _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:430)\n> #9      _microtaskLoop (dart:async/schedule_microtask.dart:43)\n> #10     _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)\n> #11     _ScheduleImmediateHelper._handleMutation (dart:html:49298)\n> #12     MutationObserver._create.<anonymous closure> (dart:html:27545)\n>\n> it fails on this line:\n>\n> patch map(p0, [p1=_UNDEFINED_JS_CONST]) => js_library.context['Leaflet']['map'].apply([p0,p1].takeWhile((i) => i != _UNDEFINED_JS_CONST).toList());\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/dart-lang/sdk/issues/25318#issuecomment-167632864>.\n>\n"}}