Skip to content

Commit

Permalink
chore(release): 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Coe committed Dec 27, 2016
1 parent 2d781da commit 590abf6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="1.3.1"></a>
## [1.3.1](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.3.0...v1.3.1) (2016-12-27)


### Bug Fixes

* function declaration assignment now retains function name ([#33](https://github.com/istanbuljs/istanbul-lib-instrument/issues/33)) ([2d781da](https://github.com/istanbuljs/istanbul-lib-instrument/commit/2d781da))



<a name="1.3.0"></a>
# [1.3.0](https://github.com/istanbuljs/istanbul-lib-instrument/compare/v1.2.0...v1.3.0) (2016-11-10)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "istanbul-lib-instrument",
"version": "1.3.0",
"version": "1.3.1",
"description": "Core istanbul API for JS code coverage",
"author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",
"main": "dist/index.js",
Expand Down

7 comments on commit 590abf6

@bcoe
Copy link
Contributor

@bcoe bcoe commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Attrash-Islam can you share the project that is having this error?

@bcoe
Copy link
Contributor

@bcoe bcoe commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wyze any thoughts on this one? seems to be similar behavior to this issue:

mishoo/UglifyJS#179

@wyze
Copy link
Collaborator

@wyze wyze commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the issue from uglify, it seems like this code would be what is causing the error:

const area = function(something, area) {
  // do things
}

@Attrash-Islam, do you have something along those lines in your codebase?

@bcoe, one thing comes to mind, as this is mainly aimed towards React components for their displayName. I could put a guard in to check and see if a parameter of the function matches the variable declaration name, if so, do something like const area = function _area(something, area) {} instead.

@wyze
Copy link
Collaborator

@wyze wyze commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been able to come up with a failing test case that reproduces this though.

@bcoe
Copy link
Contributor

@bcoe bcoe commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wyze great, I think this safety would be good 👍 great catch. I didn't know about this strict rule -- I believe it's only in certain browsers?

@wyze
Copy link
Collaborator

@wyze wyze commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll get that test case coded up. I can reproduce the error in PhantomJS REPL though:

phantomjs> 'use strict'; var area = function area(a, area) { console.log('a', area); }; area()
Cannot declare a parameter named 'area' in strict mode

  phantomjs://repl-input:1 in global code
phantomjs> 'use strict'; var area = function _area(a, area) { console.log('a', area); }; area()
a undefined
undefined

@bcoe
Copy link
Contributor

@bcoe bcoe commented on 590abf6 Dec 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wyze awesome; I'd rather not pull phantom in as a dependency, but a test that would fail in a phantom environment would be good.

maybe add an additional npm script that executes in phantom, but that we don't run in CI?

Please sign in to comment.