Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-08-24 01:52:11 +03:00
parent 81a45fd839
commit f204f02d65

View File

@ -922,12 +922,14 @@ object.Constructor('Parser', {
//
// .onArgs(callback(args))
//
// .onNoArgs(callback())
// .onNoArgs(callback(args))
//
//
// NOTE: args is mutable and thus can be modified here affecting
// further parsing.
onArgs: afterCallback('onArgs'),
onNoArgs: afterCallback('onNoArgs'),
// Post-parsing callbacks...
//
// .then(callback(unhandled, root_value, rest))
@ -999,6 +1001,7 @@ object.Constructor('Parser', {
script.length - parsed.scriptName.length)
// call the pre-parse handlers...
// NOTE: these can modify the mutable rest if needed...
rest.length == 0 ?
this.onNoArgs(rest)
: this.onArgs(rest)