diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-07-06 14:38:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-06 14:38:12 +0200 |
commit | 1aac47720b8dad6826d59263f8e825c221f2a328 (patch) | |
tree | 198e239c8389ef168fbb8dde5aecb11105a170e4 /extensions/web/04_global_interfaces.js | |
parent | f139a0cc11f0b3a7e3cb1975310c079e4741d199 (diff) |
refactor: use primordials in extensions/web (#11273)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'extensions/web/04_global_interfaces.js')
-rw-r--r-- | extensions/web/04_global_interfaces.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/extensions/web/04_global_interfaces.js b/extensions/web/04_global_interfaces.js index c3181fb66..8117bface 100644 --- a/extensions/web/04_global_interfaces.js +++ b/extensions/web/04_global_interfaces.js @@ -1,7 +1,16 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. "use strict"; + +// @ts-check +/// <reference path="../../core/internal.d.ts" /> + ((window) => { const { EventTarget } = window; + const { + Symbol, + SymbolToStringTag, + TypeError, + } = window.__bootstrap.primordials; const illegalConstructorKey = Symbol("illegalConstructorKey"); @@ -13,7 +22,7 @@ super(); } - get [Symbol.toStringTag]() { + get [SymbolToStringTag]() { return "Window"; } } @@ -26,7 +35,7 @@ super(); } - get [Symbol.toStringTag]() { + get [SymbolToStringTag]() { return "WorkerGlobalScope"; } } @@ -39,7 +48,7 @@ super(); } - get [Symbol.toStringTag]() { + get [SymbolToStringTag]() { return "DedicatedWorkerGlobalScope"; } } |