mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
Do not convert the worker object in jsinterop, just like we do for window
This makes it possible to do: js.context['self'].addEventListener('message', allowInterop((e) => print('received'))); Change-Id: I202b6c881372a77c0ec41dd334e9aa76286d7796 Reviewed-on: https://dart-review.googlesource.com/54068 Reviewed-by: Stephen Adams <sra@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
parent
f62302b8ee
commit
410db09743
|
@ -2,7 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:html' show Blob, Event, ImageData, Node, Window;
|
||||
import 'dart:html' show Blob, Event, ImageData, Node, Window, WorkerGlobalScope;
|
||||
import 'dart:indexed_db' show KeyRange;
|
||||
import 'dart:_js_helper' show patch;
|
||||
import 'dart:_foreign_helper' show JS;
|
||||
|
@ -14,8 +14,9 @@ bool isBrowserObject(dynamic o) =>
|
|||
o is KeyRange ||
|
||||
o is ImageData ||
|
||||
o is Node ||
|
||||
o is Window;
|
||||
o is Window ||
|
||||
o is WorkerGlobalScope;
|
||||
|
||||
@patch
|
||||
Object convertFromBrowserObject(dynamic o) =>
|
||||
JS('Blob|Event|KeyRange|ImageData|Node|Window', '#', o);
|
||||
JS('Blob|Event|KeyRange|ImageData|Node|Window|WorkerGlobalScope', '#', o);
|
||||
|
|
Loading…
Reference in a new issue