Skip to content

Commit cf10fc8

Browse files
committed
Downlevel for IE11
(cherry picked from commit 72c3fd7)
1 parent 4bb35a7 commit cf10fc8

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

lib/index.js

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -554,61 +554,59 @@ module.exports = {
554554
this.ui.writeWarnLine('[DEPRECATION] ' + globalMessage);
555555
}
556556

557-
let onDotAccess = `(dotKey, importKey, module) => {
558-
let message =
559-
\`Using \\\`\${dotKey}\\\` has been deprecated. Instead, import the value directly from \${module}:\\n\\n\` +
560-
\` import { \${importKey} } from '\${module}';\\n\\n\` +
561-
'These usages may be caused by an outdated ember-cli-babel dependency. ' +
562-
${JSON.stringify(suggestions)};
563-
564-
if (${
565-
hasActionableSuggestions &&
566-
process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all'
567-
}) {
568-
message +=
569-
'\\n### Important ###\\n\\n' +
570-
'In order to avoid repeatedly showing the same deprecation messages, ' +
571-
'no further deprecation messages will be shown for theses deprecated usages ' +
572-
'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' +
573-
'To see all instances of this deprecation message, ' +
574-
'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' +
575-
'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n';
576-
}
557+
let onDotAccess = `function (dotKey, importKey, module) {
558+
var message =
559+
'Using \`' + dotKey + '\` has been deprecated. Instead, import the value directly from ' + module + ':\\n\\n' +
560+
' import { ' + importKey + ' } from \\'' + module + '\\';\\n\\n' +
561+
'These usages may be caused by an outdated ember-cli-babel dependency. ' +
562+
${JSON.stringify(suggestions)};
563+
564+
if (${
565+
hasActionableSuggestions &&
566+
process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all'
567+
}) {
568+
message +=
569+
'\\n### Important ###\\n\\n' +
570+
'In order to avoid repeatedly showing the same deprecation messages, ' +
571+
'no further deprecation messages will be shown for theses deprecated usages ' +
572+
'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' +
573+
'To see all instances of this deprecation message, ' +
574+
'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' +
575+
'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n';
576+
}
577577
578-
message += ${JSON.stringify(details)};
578+
message += ${JSON.stringify(details)};
579579
580-
return message;
581-
}`;
580+
return message;
581+
}`;
582582

583583
this._bootstrapEmber = `
584584
require('@ember/-internals/bootstrap').default(
585585
${JSON.stringify(globalMessage)},
586586
${hasActionableSuggestions && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all'}
587587
);
588588
589-
{
590-
let disabled = false;
591-
592-
let once = ${
593-
hasActionableSuggestions &&
594-
process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all'
595-
};
596-
597-
let _onDotAccess = ${onDotAccess};
598-
599-
let onDotAccess = (...args) => {
589+
(function(disabled, once, _onDotAccess) {
590+
var onDotAccess = function () {
600591
if (disabled) {
601592
return null;
602593
} else {
603594
disabled = once;
604-
return _onDotAccess(...args);
595+
return _onDotAccess.apply(undefined, arguments);
605596
}
606597
};
607598
608599
require('@ember/object')._onDotAccess(onDotAccess);
609600
610601
require('@ember/runloop')._onDotAccess(onDotAccess);
611-
}
602+
})(
603+
false,
604+
${
605+
hasActionableSuggestions &&
606+
process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all'
607+
},
608+
${onDotAccess}
609+
);
612610
`;
613611
},
614612
};

0 commit comments

Comments
 (0)