Modifying the es5 and es6 templates for javascript to handle default values (#6649)

for required fields better. This change ensures the required field isn't
overridden with undefined when the object is constructed - especially through
a chain of constructFromObject calls..
This commit is contained in:
Troy P
2020-08-20 00:24:11 -07:00
committed by GitHub
parent 866df36c94
commit 71321bd049
4 changed files with 8 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ class Category {
* Only for internal use.
*/
static initialize(obj, name) {
obj['name'] = name;
obj['name'] = name || 'default-name';
}
/**