Skip to content

Commit 10dae84

Browse files
committed
address comments
1 parent e1abb31 commit 10dae84

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/parse.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,13 @@ function parse(source, root, options) {
372372
case "required":
373373
if (edition)
374374
throw illegal(token);
375-
break;
375+
/* eslint-disable no-fallthrough */
376376
case "repeated":
377377
parseField(type, token);
378378
break;
379379

380380
case "optional":
381381
/* istanbul ignore if */
382-
// console.log('in optional?')
383-
// console.log('')
384382
if (isProto3) {
385383
parseField(type, "proto3_optional");
386384
} else if (edition) {
@@ -404,8 +402,9 @@ function parse(source, root, options) {
404402

405403
default:
406404
/* istanbul ignore if */
407-
if (!isProto3 && !edition || !typeRefRe.test(token))
405+
if (!isProto3 && !edition || !typeRefRe.test(token)) {
408406
throw illegal(token);
407+
}
409408

410409
push(token);
411410
parseField(type, "optional");

src/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ util.decorateEnum = function decorateEnum(object) {
171171
* @param {Object.<string,*>} dst Destination object
172172
* @param {string} path dot '.' delimited path of the property to set
173173
* @param {Object} value the value to set
174-
* @param {boolean} overWrite whether or not to concatenate the values into an array or overwrite
174+
* @param {boolean} overWrite whether or not to concatenate the values into an array or overwrite; defaults to false.
175175
* @returns {Object.<string,*>} Destination object
176176
*/
177-
util.setProperty = function setProperty(dst, path, value, overWrite) {
177+
util.setProperty = function setProperty(dst, path, value, overWrite = false) {
178178
function setProp(dst, path, value) {
179179
var part = path.shift();
180180
if (part === "__proto__" || part === "prototype") {

0 commit comments

Comments
 (0)