Skip to content

Commit b97ad94

Browse files
author
Robert Jackson
committed
Make setTimeout/clearTimeout available to the template compiler sandbox
1 parent c1f98b1 commit b97ad94

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
@@ -132,6 +132,13 @@ function getTemplateCompiler(templateCompilerPath, EmberENV = {}) {
132132

133133
let sandbox = {
134134
EmberENV: clonedEmberENV,
135+
136+
// Older versions of ember-template-compiler (up until [email protected])
137+
// eagerly access `setTimeout` without checking via `typeof` first
138+
setTimeout,
139+
clearTimeout,
140+
141+
// fake the module into thinking we are running inside a Node context
135142
module: { require, exports: {} },
136143
require,
137144
};

0 commit comments

Comments
 (0)