update metadata queries to include edits
This commit is contained in:
@@ -86,9 +86,8 @@ var handleCommand = function (meta, line) {
|
||||
Meta.createLineHandler = function (ref, errorHandler) {
|
||||
ref.meta = {};
|
||||
|
||||
errorHandler = errorHandler;
|
||||
|
||||
return function (err, line, index) {
|
||||
var index = 0;
|
||||
return function (err, line) {
|
||||
if (err) {
|
||||
return void errorHandler('METADATA_HANDLER_LINE_ERR', {
|
||||
error: err,
|
||||
@@ -98,11 +97,12 @@ Meta.createLineHandler = function (ref, errorHandler) {
|
||||
}
|
||||
|
||||
if (Array.isArray(line)) {
|
||||
index++;
|
||||
try {
|
||||
handleCommand(ref.meta, line);
|
||||
} catch (err) {
|
||||
} catch (err2) {
|
||||
errorHandler("METADATA_COMMAND_ERR", {
|
||||
error: err.stack,
|
||||
error: err2.stack,
|
||||
line: line,
|
||||
});
|
||||
}
|
||||
@@ -110,6 +110,7 @@ Meta.createLineHandler = function (ref, errorHandler) {
|
||||
}
|
||||
|
||||
if (index === 0 && typeof(line) === 'object') {
|
||||
index++;
|
||||
// special case!
|
||||
ref.meta = line;
|
||||
return;
|
||||
@@ -117,7 +118,7 @@ Meta.createLineHandler = function (ref, errorHandler) {
|
||||
|
||||
errorHandler("METADATA_HANDLER_WEIRDLINE", {
|
||||
line: line,
|
||||
index: index
|
||||
index: index++,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user