Skip to content

Commit

Permalink
Merge pull request #547 from saqibnoorani/Fix-aurelia/testing-bug
Browse files Browse the repository at this point in the history
Fix istanbul bug
  • Loading branch information
fkleuver authored Apr 15, 2020
2 parents cde6dff + b59d63d commit b19ecd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/property-accessor-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PropertyAccessorParser {

export function getAccessorExpression(fn: string): string {
/* tslint:disable:max-line-length */
const classic = /^function\s*\([$_\w\d]+\)\s*\{(?:\s*"use strict";)?\s*(?:[$_\w\d.['"\]+;]+)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/;
const classic = /^function\s*\([$_\w\d]+\)\s*\{(?:\s*"use strict";)?(?:[$_\s\w\d\/\*.['"\]+;]+)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/;
/* tslint:enable:max-line-length */
const arrow = /^\(?[$_\w\d]+\)?\s*=>\s*[$_\w\d]+\.([$_\w\d]+)$/;
const match = classic.exec(fn) || arrow.exec(fn);
Expand Down
3 changes: 3 additions & 0 deletions test/property-accessor-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ describe('PropertyAccessorParser', () => {
// tslint:disable-next-line:max-line-length
expect(parse('function(a){"use strict";_gen$field.f[\'10\']++;_aGen$field.g[\'10\']++;return a.b;}'))
.toEqual('b');
// tslint:disable-next-line:max-line-length
expect(parse('function(a){/* istanbul ignore next */ cov_1wjh4ld5ut.f[9]++;cov_1wjh4ld5ut.s[50]++;return a.b;}'))
.toEqual('b');
});
});

0 comments on commit b19ecd7

Please sign in to comment.