-
Notifications
You must be signed in to change notification settings - Fork 6k
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
base: master
Are you sure you want to change the base?
Issue 5978 #6431
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
{{>licenseInfo}} | ||
import expect, { createSpy, spyOn, isSpy } from 'expect'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any use of these. |
||
|
||
(function(root, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
// AMD. | ||
define(['expect.js', '../../src/index'], factory); | ||
} else if (typeof module === 'object' && module.exports) { | ||
// CommonJS-like environments that support module.exports, like Node. | ||
factory(require('expect.js'), require('../../src/index')); | ||
} else { | ||
// Browser globals (root is window) | ||
factory(root.expect, root.{{moduleName}}); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
}(this, function(expect, {{moduleName}}) { | ||
'use strict'; | ||
|
||
var instance; | ||
let instance; | ||
|
||
beforeEach(function() { | ||
{{#models}} | ||
|
@@ -25,15 +18,15 @@ | |
{{/models}} | ||
}); | ||
|
||
var getProperty = function(object, getter, property) { | ||
let getProperty = function(object, getter, property) { | ||
// Use getter method if present; otherwise, get the property directly. | ||
if (typeof object[getter] === 'function') | ||
return object[getter](); | ||
else | ||
return object[property]; | ||
} | ||
|
||
var setProperty = function(object, setter, property, value) { | ||
let setProperty = function(object, setter, property, value) { | ||
// Use setter method if present; otherwise, set the property directly. | ||
if (typeof object[setter] === 'function') | ||
object[setter](value); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wing328 So that what the change does, doesn't it? It changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @frol ah sorry. You're right. I misread. |
||
{{/vars}} | ||
|
||
{{#useInheritance}}{{#interfaceModels}} | ||
|
@@ -75,7 +75,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}}; | ||
{{/allVars}} | ||
{{/interfaceModels}}{{/useInheritance}} | ||
|
||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 intosanitizeName
once instead of copy-pasting.