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:
Sigmund Cherem 2018-05-07 21:10:43 +00:00 committed by commit-bot@chromium.org
parent f62302b8ee
commit 410db09743

View file

@ -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);