File tree 2 files changed +36
-30
lines changed 2 files changed +36
-30
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const HookMap = require("tapable/lib/HookMap");
13
13
const vm = require ( "vm" ) ;
14
14
const BasicEvaluatedExpression = require ( "./BasicEvaluatedExpression" ) ;
15
15
const StackedSetMap = require ( "./util/StackedSetMap" ) ;
16
+ const TrackingSet = require ( "./util/TrackingSet" ) ;
16
17
17
18
const joinRanges = ( startRange , endRange ) => {
18
19
if ( ! endRange ) return startRange ;
@@ -40,36 +41,6 @@ const POSSIBLE_AST_OPTIONS = [{
40
41
}
41
42
} ] ;
42
43
43
- class TrackingSet {
44
- constructor ( set ) {
45
- this . set = set ;
46
- this . set2 = new Set ( ) ;
47
- this . stack = set . stack ;
48
- }
49
-
50
- add ( item ) {
51
- this . set2 . add ( item ) ;
52
- return this . set . add ( item ) ;
53
- }
54
-
55
- delete ( item ) {
56
- this . set2 . delete ( item ) ;
57
- return this . set . delete ( item ) ;
58
- }
59
-
60
- has ( item ) {
61
- return this . set . has ( item ) ;
62
- }
63
-
64
- createChild ( ) {
65
- return this . set . createChild ( ) ;
66
- }
67
-
68
- getAddedItems ( ) {
69
- return this . set2 ;
70
- }
71
- }
72
-
73
44
class Parser extends Tapable {
74
45
constructor ( options ) {
75
46
super ( ) ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+ "use strict" ;
6
+
7
+ module . exports = class TrackingSet {
8
+ constructor ( set ) {
9
+ this . set = set ;
10
+ this . set2 = new Set ( ) ;
11
+ this . stack = set . stack ;
12
+ }
13
+
14
+ add ( item ) {
15
+ this . set2 . add ( item ) ;
16
+ return this . set . add ( item ) ;
17
+ }
18
+
19
+ delete ( item ) {
20
+ this . set2 . delete ( item ) ;
21
+ return this . set . delete ( item ) ;
22
+ }
23
+
24
+ has ( item ) {
25
+ return this . set . has ( item ) ;
26
+ }
27
+
28
+ createChild ( ) {
29
+ return this . set . createChild ( ) ;
30
+ }
31
+
32
+ getAddedItems ( ) {
33
+ return this . set2 ;
34
+ }
35
+ } ;
You can’t perform that action at this time.
0 commit comments