File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const HookMap = require("tapable/lib/HookMap");
1313const vm = require ( "vm" ) ;
1414const BasicEvaluatedExpression = require ( "./BasicEvaluatedExpression" ) ;
1515const StackedSetMap = require ( "./util/StackedSetMap" ) ;
16+ const TrackingSet = require ( "./util/TrackingSet" ) ;
1617
1718const joinRanges = ( startRange , endRange ) => {
1819 if ( ! endRange ) return startRange ;
@@ -40,36 +41,6 @@ const POSSIBLE_AST_OPTIONS = [{
4041 }
4142} ] ;
4243
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-
7344class Parser extends Tapable {
7445 constructor ( options ) {
7546 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