Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

fix contstructor to handle null options #31

Merged
merged 1 commit into from
Feb 9, 2016
Merged

fix contstructor to handle null options #31

merged 1 commit into from
Feb 9, 2016

Conversation

kkpoon
Copy link
Contributor

@kkpoon kkpoon commented Feb 9, 2016

  • possible that user may give null in options parameter in constructor
  • for example, no tsconfig.json file when using espower-typescript

when using espower-typescript as mocha compiler, there is an error about options parameter in constructor is null.

./node_modules/espower-typescript/node_modules/typescript-simple/index.js:29
            if (options.target == null) {
                       ^

TypeError: Cannot read property 'target' of null

after a few tests, I found that could happen when I remove the tsconfig.json file.

for evaluating undefined and null, I make this test in Typescript playground

- possible that user may give null in options parameter in constructor
- for example, no `tsconfig.json` file when using `espower-typescript`
teppeis added a commit that referenced this pull request Feb 9, 2016
fix contstructor to handle null options
@teppeis teppeis merged commit 92edc1f into teppeis:master Feb 9, 2016
@teppeis
Copy link
Owner

teppeis commented Feb 9, 2016

@kkpoon nice catch!

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.

2 participants