Status: Accepted
Owner: ----
CC: [email protected]
Labels: Type-Bug Priority-Medium

New issue 3223 by [email protected]: Minimizer broken for try-catch
http://code.google.com/p/v8/issues/detail?id=3223

Our internal minimizer does not handle catch-bound variables correctly. For the following function it will rename `promise` to `e` such that it clashes with the catch-bound `e`:

function PromiseCoerce(constructor, x) {
  if (!IsPromise(x) && IS_SPEC_OBJECT(x)) {
    var then;
    try {
      then = x.then;
    } catch(e) {
      var dummy;
      var promise = %_CallFunction(constructor, e, PromiseRejected);
      PromiseCoerce.table.set(x, promise);
      return promise;
    }
    if (typeof then === 'function') {
      if (PromiseCoerce.table.has(x)) {
        return PromiseCoerce.table.get(x);
      } else {
        var deferred = %_CallFunction(constructor, PromiseDeferred);
        PromiseCoerce.table.set(x, deferred.promise);
        try {
          %_CallFunction(x, deferred.resolve, deferred.reject, then);
        } catch(e) {
          deferred.reject(e);
        }
        return deferred.promise;
      }
    }
  }
  return x;
}


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to