Supply default option value only if the option is not specified

The "|| trick" is too brittle in this case -- it wouldn't work e.g. for
options with default value |true| and passed value |false|, enforcing
inconsistent default values handling.
redux
David Majda 12 years ago
parent 2aaa038499
commit 1ee6731b51

@ -1,7 +1,9 @@
/* Emits the generated code for the AST. */ /* Emits the generated code for the AST. */
PEG.compiler.emitter = function(ast, options) { PEG.compiler.emitter = function(ast, options) {
options = options || {}; options = options || {};
options.trackLineAndColumn = options.trackLineAndColumn || false; if (options.trackLineAndColumn === undefined) {
options.trackLineAndColumn = false;
}
/* /*
* Codie 1.1.0 * Codie 1.1.0

Loading…
Cancel
Save