Skip to content

Issue 5978 #6431

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Issue 5978 #6431

wants to merge 2 commits into from

Conversation

CodeNinjai
Copy link
Contributor

@CodeNinjai CodeNinjai commented Sep 4, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

Description of the PR

Fixes #5978

@@ -65,7 +65,7 @@ export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtension
* @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}}
* @default {{{defaultValue}}}{{/defaultValue}}
*/{{/emitJSDoc}}
{{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}};
{{name}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}};
Copy link
Contributor

Choose a reason for hiding this comment

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

@CodeNinjai I still think this should be {{name}} instead of {{baseName}}

e.g. {{baseName}} (original name specified in the spec) can be "modified-date" while {{name}} is the variable name following JS style guide (e.g. modified_date)

cc @cliffano @frol

Copy link
Contributor

Choose a reason for hiding this comment

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

@wing328 So that what the change does, doesn't it? It changes {{ baseName }} to {{ name }}.

Copy link
Contributor

Choose a reason for hiding this comment

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

@frol ah sorry. You're right. I misread.

@@ -500,7 +509,7 @@ public String toVarName(String name) {

// camelize (lower first character) the variable name
// pet_id => petId
name = camelize(name, true);
//name = camelize(name, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

@CodeNinjai Commenting out camelize will probably impact JS ES5 output as well. Shall we keep it as it's?

cc @frol @cliffano

Copy link
Contributor

Choose a reason for hiding this comment

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

@CodeNinjai Given the code style guides for JS, camel-case should be used for variable and method names. Please, bring it back.

Also, it seems that the custom name.matches(...) should be simply placed into sanitizeName once instead of copy-pasting.

// Browser globals (root is window)
factory(root.expect, root.{{moduleName}});
}

Copy link
Contributor

Choose a reason for hiding this comment

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

How is this going to work? The module will be empty since the factory isn't called.

@@ -1,19 +1,12 @@
{{>licenseInfo}}
import expect, { createSpy, spyOn, isSpy } from 'expect';
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any use of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants