Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

BUG REPRO: ie8 bug when module() inside it() throws and exception (thrown during in... #4221

Closed
wants to merge 1 commit into from

Conversation

chirayuk
Copy link
Contributor

@chirayuk chirayuk commented Oct 2, 2013

ie8 bug when module() inside it() throws and exception (thrown during inject() call)

This is a bug where my exception object is getting lost. Here's the
result from a Karma trace:

Running "autotest:jqlite" (autotest) task
INFO [karma]: Karma v0.11.0 server started at http://localhost:9876/
WARN [web-server]: 404: /favicon.ico
INFO [IE 8.0.0 (Windows XP)]: Connected on socket hfE_1IJ4LeFwf6RJcVOe
INFO [watcher]: Changed file "/Users/chirayu/work/angular.js/test/ng/sceSpecs.js".
INFO [karma]: Delaying execution, these browsers are not ready: IE 8.0.0 (Windows XP)
IE 8.0.0 (Windows XP) SCE CKCK: IE8 TypeError FAILED
        Expected function to throw CKCK: foo , but it threw Object doesn't support this property or method
IE 8.0.0 (Windows XP): Executed 1 of 2225 (1 FAILED) (skipped 2224) ERROR (7.738 secs / 0.031 secs)

I don't see the real exception but get a TypeError. There is only one
stack frame between when the exception object is the one I want and the
one where it's been replaced by TypeError. No code executes between
those two frames afaik from looking at the IE8 debugger.

In the inject() call:

  if (!injector) {
    injector = currentSpec.$injector = angular.injector(modules);
  }

the exception is thrown in "injector = currentSpec.$injector = angular.injector(modules);"

making injector undefined. The caller frame is the anonymous function
in the expect() line:

expect(function() { inject(angular.nop); }).toThrow('CKCK: foo');

When control reaches that frame through, the exception object is no
longer "CKCK: foo" but a TypeError. :(

… inject() call)

This is a bug where my exception object is getting lost.  Here's the
result from a Karma trace:

    Running "autotest:jqlite" (autotest) task
    INFO [karma]: Karma v0.11.0 server started at http://localhost:9876/
    WARN [web-server]: 404: /favicon.ico
    INFO [IE 8.0.0 (Windows XP)]: Connected on socket hfE_1IJ4LeFwf6RJcVOe
    INFO [watcher]: Changed file "/Users/chirayu/work/angular.js/test/ng/sceSpecs.js".
    INFO [karma]: Delaying execution, these browsers are not ready: IE 8.0.0 (Windows XP)
    IE 8.0.0 (Windows XP) SCE CKCK: IE8 TypeError FAILED
            Expected function to throw CKCK: foo , but it threw Object doesn't support this property or method
    IE 8.0.0 (Windows XP): Executed 1 of 2225 (1 FAILED) (skipped 2224) ERROR (7.738 secs / 0.031 secs)

I don't see the real exception but get a TypeError.  There is only one
stack frame between when the exception object is the one I want and the
one where it's been replaced by TypeError.  No code executes between
those two frames afaik from looking at the IE8 debugger.

In the inject() call:

      if (!injector) {
        injector = currentSpec.$injector = angular.injector(modules);
      }

the exception is thrown in "injector = currentSpec.$injector = angular.injector(modules);"

making injector undefined.  The caller frame is the anonymous function
in the expect() line:

    expect(function() { inject(angular.nop); }).toThrow('CKCK: foo');

When control reaches that frame through, the exception object is no
longer "CKCK: foo" but a TypeError.  :(
@mary-poppins
Copy link

OMG Chirayu!  Have you lost your marbles? What kind of a PR is this?? I flatly disapprove!

But … on second thoughts, as long as you promise not to merge it in, and since you're such a great guy, feel free to continue to fool around.  👯

@ghost ghost assigned IgorMinar Oct 2, 2013
@chirayuk
Copy link
Contributor Author

chirayuk commented Oct 2, 2013

Simplest version – see screenshot at http://i.imgur.com/dwj6tWy.png.

@chirayuk chirayuk closed this in 6231a7c Oct 2, 2013
@chirayuk chirayuk deleted the ie8_bug branch October 2, 2013 07:15
chirayuk added a commit that referenced this pull request Oct 2, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
ammula88 pushed a commit to ammula88/angular.js that referenced this pull request Feb 18, 2016
ammula88 pushed a commit to ammula88/angular.js that referenced this pull request Feb 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants