Angular and IE9 stupidity where native methods

Angular 1.2.0 has such a funny comment:

// Stupidity IE! (IE is not applicable for some native functions)

It is located on line 9835 in the functionCall function:

  functionCall: function(fn, contextGetter) {
    var argsFn = [];
    if (this.peekToken().text !== ')') {
      do {
        argsFn.push(this.expression());
      } while (this.expect(','));
    }
    this.consume(')');

    var parser = this;

    return function(scope, locals) {
      var args = [];
      var context = contextGetter ? contextGetter(scope, locals) : scope;

      for (var i = 0; i < argsFn.length; i++) {
        args.push(argsFn[i](scope, locals));
      }
      var fnPtr = fn(scope, locals, context) || noop;

      ensureSafeObject(context, parser.text);
      ensureSafeObject(fnPtr, parser.text);

      // IE stupidity! (IE doesn't have apply for some native functions)
      var v = fnPtr.apply
            ? fnPtr.apply(context, args)
            : fnPtr(args[0], args[1], args[2], args[3], args[4]);

      return ensureSafeObject(v, parser.text);
    };
  },

I believe that it hurts me, but there are no errors, so it’s hard for me to find exactly which eigenfunction it can try (and does not work) to call. Ever since I implemented the $ q library to use promises to handle asynchronous REST calls, IE9 doesn’t even try to call services (according to the network tab in dev tools). Instead, the promise is rejected immediately. I tried looking for an answer and looked at Angular docs about using IE , but I'm not leaving anywhere.

- promises IE9 Angular "q-lite"? - , ?

+4
1

, . -, , q promises... q.all([]):

$q.all([
  firstRequest.$promise,
  secondRequest.$promise,
  thirdRequest.$promise,
  moreRequets.$promise
]).then(function() {
  //do stuff
});

, angular, some native functions, , docs . apply() :

. , Chrome 14 Internet Explorer 9, , , .

, $q.all . , , . - , IE angular, , , .

FYI, angular 1.2.14.

+1

Source: https://habr.com/ru/post/1530316/


All Articles