Skip to content

Instantly share code, notes, and snippets.

@joliss
Created August 6, 2015 17:45
Show Gist options
  • Select an option

  • Save joliss/fcf00ce6df3d136e0359 to your computer and use it in GitHub Desktop.

Select an option

Save joliss/fcf00ce6df3d136e0359 to your computer and use it in GitHub Desktop.
function CachingWriter(inputTrees, options) {
if (Array.isArray(inputTrees)) {
if (this.enforceSingleInputTree) { // <---- in ES6, `this` is not defined before super
throw new Error('You passed an array of input trees, but only a single tree is allowed.');
}
inputTrees = inputTrees;
} else {
inputTrees = [inputTrees];
}
Plugin.call(this, inputTrees);
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment