|
2 | 2 | MIT License http://www.opensource.org/licenses/mit-license.php |
3 | 3 | Author Tobias Koppers @sokra |
4 | 4 | */ |
5 | | -var Dependency = require("../Dependency"); |
| 5 | +"use strict"; |
| 6 | +const Dependency = require("../Dependency"); |
6 | 7 |
|
7 | | -function ContextDependency(request, recursive, regExp) { |
8 | | - Dependency.call(this); |
9 | | - this.request = request; |
10 | | - this.userRequest = request; |
11 | | - this.recursive = recursive; |
12 | | - this.regExp = regExp; |
13 | | - this.async = false; |
| 8 | +class ContextDependency extends Dependency { |
| 9 | + constructor(request, recursive, regExp) { |
| 10 | + super(); |
| 11 | + this.request = request; |
| 12 | + this.userRequest = request; |
| 13 | + this.recursive = recursive; |
| 14 | + this.regExp = regExp; |
| 15 | + this.async = false; |
| 16 | + } |
| 17 | + |
| 18 | + isEqualResource(other) { |
| 19 | + if(!(other instanceof ContextDependency)) |
| 20 | + return false; |
| 21 | + |
| 22 | + return this.request === other.request && |
| 23 | + this.recursive === other.recursive && |
| 24 | + this.regExp === other.regExp && |
| 25 | + this.async === other.async; |
| 26 | + } |
14 | 27 | } |
15 | | -module.exports = ContextDependency; |
16 | 28 |
|
17 | | -ContextDependency.prototype = Object.create(Dependency.prototype); |
18 | | -ContextDependency.prototype.constructor = ContextDependency; |
19 | | -ContextDependency.prototype.isEqualResource = function(other) { |
20 | | - if(!(other instanceof ContextDependency)) |
21 | | - return false; |
22 | | - return this.request === other.request && |
23 | | - this.recursive === other.recursive && |
24 | | - this.regExp === other.regExp && |
25 | | - this.async === other.async; |
26 | | -}; |
| 29 | +module.exports = ContextDependency; |
0 commit comments