mirror of https://github.com/webpack/webpack.git
Report constructor correctly when inheriting from Tapable
This commit is contained in:
parent
c0afdf9c6a
commit
8ff6cb5fed
|
@ -59,6 +59,8 @@ function Compilation(compiler) {
|
||||||
module.exports = Compilation;
|
module.exports = Compilation;
|
||||||
|
|
||||||
Compilation.prototype = Object.create(Tapable.prototype);
|
Compilation.prototype = Object.create(Tapable.prototype);
|
||||||
|
Compilation.prototype.constructor = Compilation;
|
||||||
|
|
||||||
Compilation.prototype.templatesPlugin = function(name, fn) {
|
Compilation.prototype.templatesPlugin = function(name, fn) {
|
||||||
this.mainTemplate.plugin(name, fn);
|
this.mainTemplate.plugin(name, fn);
|
||||||
this.chunkTemplate.plugin(name, fn);
|
this.chunkTemplate.plugin(name, fn);
|
||||||
|
|
|
@ -152,6 +152,7 @@ function Compiler() {
|
||||||
module.exports = Compiler;
|
module.exports = Compiler;
|
||||||
|
|
||||||
Compiler.prototype = Object.create(Tapable.prototype);
|
Compiler.prototype = Object.create(Tapable.prototype);
|
||||||
|
Compiler.prototype.constructor = Compiler;
|
||||||
|
|
||||||
Compiler.Watching = Watching;
|
Compiler.Watching = Watching;
|
||||||
Compiler.prototype.watch = function(watchOptions, handler) {
|
Compiler.prototype.watch = function(watchOptions, handler) {
|
||||||
|
|
|
@ -16,6 +16,8 @@ function ContextModuleFactory(resolvers) {
|
||||||
module.exports = ContextModuleFactory;
|
module.exports = ContextModuleFactory;
|
||||||
|
|
||||||
ContextModuleFactory.prototype = Object.create(Tapable.prototype);
|
ContextModuleFactory.prototype = Object.create(Tapable.prototype);
|
||||||
|
ContextModuleFactory.prototype.constructor = ContextModuleFactory;
|
||||||
|
|
||||||
ContextModuleFactory.prototype.create = function(context, dependency, callback) {
|
ContextModuleFactory.prototype.create = function(context, dependency, callback) {
|
||||||
this.applyPluginsAsyncWaterfall("before-resolve", {
|
this.applyPluginsAsyncWaterfall("before-resolve", {
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
@ -11,6 +11,8 @@ function DllModuleFactory() {
|
||||||
module.exports = DllModuleFactory;
|
module.exports = DllModuleFactory;
|
||||||
|
|
||||||
DllModuleFactory.prototype = Object.create(Tapable.prototype);
|
DllModuleFactory.prototype = Object.create(Tapable.prototype);
|
||||||
|
DllModuleFactory.prototype.constructor = DllModuleFactory;
|
||||||
|
|
||||||
DllModuleFactory.prototype.create = function(context, dependency, callback) {
|
DllModuleFactory.prototype.create = function(context, dependency, callback) {
|
||||||
callback(null, new DllModule(context, dependency.dependencies, dependency.name, dependency.type));
|
callback(null, new DllModule(context, dependency.dependencies, dependency.name, dependency.type));
|
||||||
};
|
};
|
||||||
|
|
|
@ -88,6 +88,7 @@ function MultiCompiler(compilers) {
|
||||||
module.exports = MultiCompiler;
|
module.exports = MultiCompiler;
|
||||||
|
|
||||||
MultiCompiler.prototype = Object.create(Tapable.prototype);
|
MultiCompiler.prototype = Object.create(Tapable.prototype);
|
||||||
|
MultiCompiler.prototype.constructor = MultiCompiler;
|
||||||
|
|
||||||
MultiCompiler.prototype.watch = function(watchDelay, handler) {
|
MultiCompiler.prototype.watch = function(watchDelay, handler) {
|
||||||
var watchings = this.compilers.map(function(compiler) {
|
var watchings = this.compilers.map(function(compiler) {
|
||||||
|
|
|
@ -11,6 +11,8 @@ function MultiModuleFactory() {
|
||||||
module.exports = MultiModuleFactory;
|
module.exports = MultiModuleFactory;
|
||||||
|
|
||||||
MultiModuleFactory.prototype = Object.create(Tapable.prototype);
|
MultiModuleFactory.prototype = Object.create(Tapable.prototype);
|
||||||
|
MultiModuleFactory.prototype.constructor = MultiModuleFactory;
|
||||||
|
|
||||||
MultiModuleFactory.prototype.create = function(context, dependency, callback) {
|
MultiModuleFactory.prototype.create = function(context, dependency, callback) {
|
||||||
callback(null, new MultiModule(context, dependency.dependencies, dependency.name));
|
callback(null, new MultiModule(context, dependency.dependencies, dependency.name));
|
||||||
};
|
};
|
||||||
|
|
|
@ -133,6 +133,8 @@ function NormalModuleFactory(context, resolvers, parser, options) {
|
||||||
module.exports = NormalModuleFactory;
|
module.exports = NormalModuleFactory;
|
||||||
|
|
||||||
NormalModuleFactory.prototype = Object.create(Tapable.prototype);
|
NormalModuleFactory.prototype = Object.create(Tapable.prototype);
|
||||||
|
NormalModuleFactory.prototype.constructor = NormalModuleFactory;
|
||||||
|
|
||||||
NormalModuleFactory.prototype.create = function(context, dependency, callback) {
|
NormalModuleFactory.prototype.create = function(context, dependency, callback) {
|
||||||
context = context || this.context;
|
context = context || this.context;
|
||||||
var request = dependency.request;
|
var request = dependency.request;
|
||||||
|
|
|
@ -16,6 +16,8 @@ module.exports = Parser;
|
||||||
// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API
|
// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API
|
||||||
|
|
||||||
Parser.prototype = Object.create(Tapable.prototype);
|
Parser.prototype = Object.create(Tapable.prototype);
|
||||||
|
Parser.prototype.constructor = Parser;
|
||||||
|
|
||||||
Parser.prototype.initializeEvaluating = function() {
|
Parser.prototype.initializeEvaluating = function() {
|
||||||
function joinRanges(startRange, endRange) {
|
function joinRanges(startRange, endRange) {
|
||||||
if(!endRange) return startRange;
|
if(!endRange) return startRange;
|
||||||
|
|
|
@ -21,6 +21,7 @@ Template.toIdentifier = function(str) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Template.prototype = Object.create(Tapable.prototype);
|
Template.prototype = Object.create(Tapable.prototype);
|
||||||
|
Template.prototype.constructor = Template;
|
||||||
|
|
||||||
Template.prototype.indent = function indent(str) {
|
Template.prototype.indent = function indent(str) {
|
||||||
if(Array.isArray(str)) {
|
if(Array.isArray(str)) {
|
||||||
|
|
Loading…
Reference in New Issue