al-duss / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Coverage plugin processes angular.js 1.0 incorrectly #384

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This source at http://code.angularjs.org/1.0.0/angular-1.0.0.js
var Error             = window.Error,
    /** holds major version number for IE or NaN for real browsers */
    msie              = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),

is parsed into

LCOV_1f[58]++; var Error             = window.Error,
    /** holds major version number for IE or NaN for real browsers */
    msie              = intLCOV_1f[60]++; ((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]),

which is incorrect

Also, line 4842 is also parsed incorrectly from

  match = {
      protocol: match[1],
      host: match[3],
      port: int(match[5]) || DEFAULT_PORTS[match[1]] || null,
      path: match[6] || '/',
      search: match[8],
      hash: match[10]
    };

to

LCOV_1f[4835]++; function matchUrl(url, obj) {
  LCOV_1f[4836]++; var match = URL_MATCH.exec(url);

  LCOV_1f[4838]++; match = {
      protocol: match[1],
      host: match[3],
      port: int(match[5]) || DEFAULT_PORTS[match[1]] || null,
      path: LCOV_1f[4842]++; match[6] || '/',
Uncaught SyntaxError: Unexpected token [
      search: LCOV_1f[4843]++; match[8],
      hash: LCOV_1f[4844]++; match[10]
    }LCOV_1f[4845]++; ;

Original issue reported on code.google.com by c...@rocketmail.com on 22 Jun 2012 at 7:06