mirror of
https://github.com/google/blockly.git
synced 2026-01-11 10:57:07 +01:00
* Reexport Blockly.utils.* modules from Blockly.utils * Update metadata (file sizes) again blockly_compressed.js has gotten too big for the second time this quarter. Update the expected file sizes for it so that tests will continue to pass.
37 lines
770 B
JavaScript
37 lines
770 B
JavaScript
/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @fileoverview Provides a reference to the global object.
|
|
* @author samelh@google.com (Sam El-Husseini)
|
|
*/
|
|
'use strict';
|
|
|
|
goog.module('Blockly.utils.global');
|
|
|
|
|
|
/**
|
|
* Reference to the global object.
|
|
*
|
|
* More info on this implementation here:
|
|
* https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI
|
|
*/
|
|
exports.globalThis = (function() { // Not "let globalThis" to avoid shadowing.
|
|
if (typeof globalThis === 'object') {
|
|
return globalThis;
|
|
}
|
|
if (typeof self === 'object') {
|
|
return self;
|
|
}
|
|
if (typeof window === 'object') {
|
|
return window;
|
|
}
|
|
if (typeof global === 'object') {
|
|
return global;
|
|
}
|
|
return this;
|
|
})();
|