Fix error when generating AMD/UMD dependencies

Generating AMD/UMD dependencies lead to an error:

  $ bin/pegjs --format amd --dependency $:jquery examples/arithmetics.pegjs
  dependencyIds is not defined

  $ bin/pegjs --format umd --dependency $:jquery examples/arithmetics.pegjs
  dependencyIds is not defined

This commit fixes the problem, which was caused by a mistake done in
d2569b9bf3.
redux
David Majda 8 years ago
parent 83d748d522
commit ef3abf33b9

@ -1275,7 +1275,7 @@ function generateJS(ast, options) {
amd() {
let dependencyVars = Object.keys(options.dependencies);
let dependencyIds = dependencyIds.map(v => options.dependencies[v]);
let dependencyIds = dependencyVars.map(v => options.dependencies[v]);
let dependencies = "["
+ dependencyIds.map(
id => "\"" + js.stringEscape(id) + "\""
@ -1313,7 +1313,7 @@ function generateJS(ast, options) {
umd() {
let parts = [];
let dependencyVars = Object.keys(options.dependencies);
let dependencyIds = dependencyIds.map(v => options.dependencies[v]);
let dependencyIds = dependencyVars.map(v => options.dependencies[v]);
let dependencies = "["
+ dependencyIds.map(
id => "\"" + js.stringEscape(id) + "\""

Loading…
Cancel
Save