mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Avoid _.extend in IE8-sensitive ecmascript tests.
The underlying problem is that `es5-shim` polyfills `Array.prototype` methods in IE8, but it can't actually make them non-enumerable, so `_.extend` copies them, because it doesn't check `hasOwnProperty`. This probably calls for a more general audit of for-in loops over objects that could be Arrays, especially within underscore.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
Tinytest.add("ecmascript - runtime - template literals", (test) => {
|
||||
function dump(pieces) {
|
||||
return [_.extend({}, pieces),
|
||||
_.toArray(arguments).slice(1)];
|
||||
var copy = {};
|
||||
// Can't use _.extend({}, pieces) because es5-shim adds enumerable
|
||||
// methods to Array.prototype, and _.extend has no own property check.
|
||||
_.each(_.keys(pieces), key => copy[key] = pieces[key]);
|
||||
return [copy, _.toArray(arguments).slice(1)];
|
||||
};
|
||||
const foo = 'B';
|
||||
// uses `babelHelpers.taggedTemplateLiteralLoose`
|
||||
|
||||
Reference in New Issue
Block a user