SIGN IN SIGN UP
angular / angular.js UNCLAIMED

AngularJS - HTML enhanced for web apps!

0 0 179 JavaScript

fix(ngMock window.inject): Remove Error 'stack' property changes

Recent browsers, particularly PhantomJS 1.9.2 and Safari 7.0
treat the stack property as non-configurable and unwritable.

Because window.inject captures the stack at the time of the inject,
and attempts to insert it into a captured throw from the injected
function by modifying e.stack, a meaningless error message and
stack is thrown instead.

This commit inserts two tests exposing the problem, and implements
a proposed solution that builds a new error-like object that mimicks
the old Error object, but with the additional stack information, and
captures the toString function from the Error object prototype.  This
appears to work for the browsers suppoerted here.
A
Andrew C. Greenberg committed
7e916455b36dc9ca4d4afc1e44cade90006d00e3
Parent: cdc4d48
Committed by Vojta Jina <vojta.jina@gmail.com> on 1/7/2014, 1:47:06 AM