should not call method slice on [object object]

It seems that you want to skip some object in by setting enumerable false to it.
But IE8 does not have Object.defineProperty.

So the following built codes in my enrty file (vendor.js) throw en error in IE8,
Object doesn't support property or method 'slice'.

for (moduleId in moreModules) {
  var _m = moreModules[moduleId];

  // Check if module is deduplicated
  switch (typeof _m) {
    case "object":
      // Module can be created from a template
      modules[moduleId] = (function(_m) {
        // in IE8 _m maybe [object object] some time, but not [object Array]
        var args = _m.slice(1),
          templateId = _m[0];
        return function(a, b, c) {
          modules[templateId].apply(this, [a, b, c].concat(args));
    case "function":
      // Normal module
      modules[moduleId] = _m;
      // Module is a copy of another module
      modules[moduleId] = modules[_m];

Author: Fantashit

1 thought on “should not call method slice on [object object]

Comments are closed.