Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromString(): version is used outside of block scope #5

Closed
mscudlik opened this issue May 8, 2020 · 1 comment
Closed

fromString(): version is used outside of block scope #5

mscudlik opened this issue May 8, 2020 · 1 comment

Comments

@mscudlik
Copy link
Contributor

mscudlik commented May 8, 2020

In method fromString() the version variable is used in line 147 to construct a new object,
but the variable is declared with a block scope inside an if statement (line 123).

This is an issue when using packageurl-js from typescript:
https://www.typescriptlang.org/docs/handbook/variable-declarations.html#block-scoping

As a consequence, fromString() always throws an error using typescript:

message:"version is not defined"
stack:"ReferenceError: version is not defined
@steven-esser
Copy link
Collaborator

@mscudlik Would #8 fix this?

This was referenced May 14, 2020
satanshiro pushed a commit to satanshiro/packageurl-js that referenced this issue Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants