ember-cli-htmlbars
Advanced tools
Comparing version 5.7.0 to 5.7.1
# Changelog | ||
## v5.7.1 (2021-03-18) | ||
#### :bug: Bug Fix | ||
* [#685](https://github.com/ember-cli/ember-cli-htmlbars/pull/685) Ensure global is present for Node 10 + globalThis polyfill ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v5.7.0 (2021-03-18) | ||
@@ -4,0 +13,0 @@ |
@@ -121,2 +121,19 @@ 'use strict'; | ||
const hasGlobalThis = (function () { | ||
try { | ||
let context = vm.createContext(); | ||
// we must create a sandboxed context to test if `globalThis` will be | ||
// present _within_ it because in some contexts a globalThis polyfill has | ||
// been evaluated. In that case globalThis would be available on the | ||
// current global context but **would not** be inherited to the global | ||
// contexts created by `vm.createContext` | ||
let type = vm.runInContext(`typeof globalThis`, context); | ||
return type !== 'undefined'; | ||
} catch (e) { | ||
return false; | ||
} | ||
})(); | ||
function getTemplateCompiler(templateCompilerPath, EmberENV = {}) { | ||
@@ -168,3 +185,3 @@ let templateCompilerFullPath = require.resolve(templateCompilerPath); | ||
// this is due to https://git.io/Jtb7s (Ember 3.27+) | ||
if (typeof globalThis === 'undefined') { | ||
if (!hasGlobalThis) { | ||
sandbox.global = sandbox; | ||
@@ -171,0 +188,0 @@ } |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "5.7.0", | ||
"version": "5.7.1", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70978
1105