Skip to content

Make sure we send options for the install_typings in both cases.#1576

Merged
paulvanbrenk merged 5 commits intomicrosoft:v1.3.xfrom
paulvanbrenk:fixTypingsAqq
May 12, 2017
Merged

Make sure we send options for the install_typings in both cases.#1576
paulvanbrenk merged 5 commits intomicrosoft:v1.3.xfrom
paulvanbrenk:fixTypingsAqq

Conversation

@paulvanbrenk
Copy link
Copy Markdown
Contributor

This fixes a null reference on options in the case of installTypingsForProject

typingsTool.installTypingsForProject(options)
} else {
typingsTool.runAll(packagesToInstall.map(function (name) {
var options = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This won't work as intended. By having options outside of this function body, you are passing the same options object in with every call to installTypingsForPackage, so unless it executes synchronously and doesn't refer to the object again - all later uses refer to the same object - so only the last settings take effect. Safer to just create a different 'options' object (maybe inline) if the other branch of the 'if' statement.

Paul van Brenk and others added 4 commits May 12, 2017 10:39
That should be a `,`
and a property in an object literal
online editor is the worst
@paulvanbrenk paulvanbrenk merged commit e06b3a8 into microsoft:v1.3.x May 12, 2017
@paulvanbrenk paulvanbrenk deleted the fixTypingsAqq branch May 12, 2017 22:29
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

Successfully merging this pull request may close these issues.

3 participants