Add basic docs for JavaScriptCompiler override API
This commit is contained in:
@@ -29,23 +29,23 @@ JavaScriptCompiler.prototype = {
|
||||
return [revision, versions];
|
||||
},
|
||||
|
||||
appendToBuffer: function(string, location, explicit) {
|
||||
// Force a string as this simplifies the merge logic.
|
||||
if (!isArray(string)) {
|
||||
string = [string];
|
||||
appendToBuffer: function(source, location, explicit) {
|
||||
// Force a source as this simplifies the merge logic.
|
||||
if (!isArray(source)) {
|
||||
source = [source];
|
||||
}
|
||||
string = this.source.wrap(string, location);
|
||||
source = this.source.wrap(source, location);
|
||||
|
||||
if (this.environment.isSimple) {
|
||||
return ['return ', string, ';'];
|
||||
return ['return ', source, ';'];
|
||||
} else if (explicit) {
|
||||
// This is a case where the buffer operation occurs as a child of another
|
||||
// construct, generally braces. We have to explicitly output these buffer
|
||||
// operations to ensure that the emitted code goes in the correct location.
|
||||
return ['buffer += ', string, ';'];
|
||||
return ['buffer += ', source, ';'];
|
||||
} else {
|
||||
string.appendToBuffer = true;
|
||||
return string;
|
||||
source.appendToBuffer = true;
|
||||
return source;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user