Skip to content

Commit 569f57a

Browse files
author
Robert Jackson
authored
Merge pull request #678 from ember-cli/expose-setTimeout
Make `setTimeout`/`clearTimeout` available to the template compiler sandbox
2 parents f0efdd2 + fc46311 commit 569f57a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ function getTemplateCompiler(templateCompilerPath, EmberENV = {}) {
145145

146146
let sandbox = {
147147
EmberENV: clonedEmberENV,
148+
149+
// Older versions of ember-template-compiler (up until [email protected])
150+
// eagerly access `setTimeout` without checking via `typeof` first
151+
setTimeout,
152+
clearTimeout,
153+
154+
// fake the module into thinking we are running inside a Node context
148155
module: { require, exports: {} },
149156
require,
150157
};

0 commit comments

Comments
 (0)