@dcloudio/uni-stacktracey 3.0.0-alpha-3061520221220001 → 3.0.0-alpha-3061620221230002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/uni-stacktracey.cjs.js +820 -856
- package/dist/uni-stacktracey.es.js +805 -839
- package/package.json +1 -1
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var fs = require('fs');
|
|
6
4
|
var path = require('path');
|
|
7
5
|
var os = require('os');
|
|
8
6
|
|
|
9
|
-
function
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
8
|
|
|
11
|
-
var fs__default = /*#__PURE__*/
|
|
12
|
-
var path__default = /*#__PURE__*/
|
|
13
|
-
var os__default = /*#__PURE__*/
|
|
9
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
10
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
11
|
+
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
14
12
|
|
|
15
13
|
/* ------------------------------------------------------------------------ */
|
|
16
14
|
const O = Object, isBrowser =
|
|
@@ -209,7 +207,14 @@ function parseItem(e, maxColumnWidths, isMP) {
|
|
|
209
207
|
/* ------------------------------------------------------------------------ */
|
|
210
208
|
var StackTracey$1 = StackTracey;
|
|
211
209
|
|
|
210
|
+
var sourceMapGenerator = {};
|
|
211
|
+
|
|
212
|
+
var base64Vlq = {};
|
|
213
|
+
|
|
214
|
+
var base64$1 = {};
|
|
215
|
+
|
|
212
216
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
217
|
+
|
|
213
218
|
/*
|
|
214
219
|
* Copyright 2011 Mozilla Foundation and contributors
|
|
215
220
|
* Licensed under the New BSD license. See LICENSE or:
|
|
@@ -222,19 +227,13 @@ const intToCharMap =
|
|
|
222
227
|
/**
|
|
223
228
|
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
|
224
229
|
*/
|
|
225
|
-
|
|
230
|
+
base64$1.encode = function (number) {
|
|
226
231
|
if (0 <= number && number < intToCharMap.length) {
|
|
227
232
|
return intToCharMap[number]
|
|
228
233
|
}
|
|
229
234
|
throw new TypeError('Must be between 0 and 63: ' + number)
|
|
230
235
|
};
|
|
231
236
|
|
|
232
|
-
var base64$1 = {
|
|
233
|
-
encode: encode$1
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
var base64 = base64$1;
|
|
237
|
-
|
|
238
237
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
239
238
|
|
|
240
239
|
/*
|
|
@@ -273,7 +272,7 @@ var base64 = base64$1;
|
|
|
273
272
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
274
273
|
*/
|
|
275
274
|
|
|
276
|
-
|
|
275
|
+
const base64 = base64$1;
|
|
277
276
|
|
|
278
277
|
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
|
279
278
|
// length quantities we use in the source map spec, the first bit is the sign,
|
|
@@ -311,7 +310,7 @@ function toVLQSigned(aValue) {
|
|
|
311
310
|
/**
|
|
312
311
|
* Returns the base 64 VLQ encoded value.
|
|
313
312
|
*/
|
|
314
|
-
|
|
313
|
+
base64Vlq.encode = function base64VLQ_encode(aValue) {
|
|
315
314
|
let encoded = '';
|
|
316
315
|
let digit;
|
|
317
316
|
|
|
@@ -331,575 +330,571 @@ var encode = function base64VLQ_encode(aValue) {
|
|
|
331
330
|
return encoded
|
|
332
331
|
};
|
|
333
332
|
|
|
334
|
-
var
|
|
335
|
-
encode: encode
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
function createCommonjsModule(fn) {
|
|
339
|
-
var module = { exports: {} };
|
|
340
|
-
return fn(module, module.exports), module.exports;
|
|
341
|
-
}
|
|
333
|
+
var util$4 = {};
|
|
342
334
|
|
|
343
335
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
344
336
|
|
|
345
|
-
|
|
346
|
-
/*
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
function getArg(aArgs, aName, aDefaultValue) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
exports.getArg = getArg;
|
|
371
|
-
|
|
372
|
-
const urlRegexp =
|
|
373
|
-
|
|
374
|
-
const dataUrlRegexp = /^data:.+\,.+$/;
|
|
375
|
-
|
|
376
|
-
function urlParse(aUrl) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
exports.urlParse = urlParse;
|
|
390
|
-
|
|
391
|
-
function urlGenerate(aParsedUrl) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
exports.urlGenerate = urlGenerate;
|
|
412
|
-
|
|
413
|
-
const MAX_CACHED_INPUTS = 32;
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
function lruMemoize(f) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
const normalize = lruMemoize(function normalize(aPath) {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
});
|
|
523
|
-
exports.normalize = normalize;
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
function join(aRoot, aPath) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
exports.join = join;
|
|
584
|
-
|
|
585
|
-
exports.isAbsolute = function (aPath) {
|
|
586
|
-
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
function relative(aRoot, aPath) {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
exports.relative = relative;
|
|
628
|
-
|
|
629
|
-
const supportsNullProto = (function () {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
})();
|
|
633
|
-
|
|
634
|
-
function identity(s) {
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
function toSetString(aStr) {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
exports.toSetString = supportsNullProto ? identity : toSetString;
|
|
655
|
-
|
|
656
|
-
function fromSetString(aStr) {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
664
|
-
|
|
665
|
-
function isProtoString(s) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
exports.compareByOriginalPositions = compareByOriginalPositions;
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
function compareByGeneratedPositionsDeflated(
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
}
|
|
780
|
-
exports.compareByGeneratedPositionsDeflated =
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
function strcmp(aStr1, aStr2) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
/**
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
}
|
|
835
|
-
exports.compareByGeneratedPositionsInflated =
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
function parseSourceMapInput(str) {
|
|
844
|
-
|
|
845
|
-
}
|
|
846
|
-
exports.parseSourceMapInput = parseSourceMapInput;
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}
|
|
899
|
-
exports.computeSourceURL = computeSourceURL;
|
|
900
|
-
});
|
|
337
|
+
(function (exports) {
|
|
338
|
+
/*
|
|
339
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
340
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
341
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* This is a helper function for getting values from parameter/options
|
|
346
|
+
* objects.
|
|
347
|
+
*
|
|
348
|
+
* @param args The object we are extracting values from
|
|
349
|
+
* @param name The name of the property we are getting.
|
|
350
|
+
* @param defaultValue An optional value to return if the property is missing
|
|
351
|
+
* from the object. If this is not specified and the property is missing, an
|
|
352
|
+
* error will be thrown.
|
|
353
|
+
*/
|
|
354
|
+
function getArg(aArgs, aName, aDefaultValue) {
|
|
355
|
+
if (aName in aArgs) {
|
|
356
|
+
return aArgs[aName]
|
|
357
|
+
} else if (arguments.length === 3) {
|
|
358
|
+
return aDefaultValue
|
|
359
|
+
}
|
|
360
|
+
throw new Error('"' + aName + '" is a required argument.')
|
|
361
|
+
}
|
|
362
|
+
exports.getArg = getArg;
|
|
363
|
+
|
|
364
|
+
const urlRegexp =
|
|
365
|
+
/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
366
|
+
const dataUrlRegexp = /^data:.+\,.+$/;
|
|
367
|
+
|
|
368
|
+
function urlParse(aUrl) {
|
|
369
|
+
const match = aUrl.match(urlRegexp);
|
|
370
|
+
if (!match) {
|
|
371
|
+
return null
|
|
372
|
+
}
|
|
373
|
+
return {
|
|
374
|
+
scheme: match[1],
|
|
375
|
+
auth: match[2],
|
|
376
|
+
host: match[3],
|
|
377
|
+
port: match[4],
|
|
378
|
+
path: match[5],
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
exports.urlParse = urlParse;
|
|
382
|
+
|
|
383
|
+
function urlGenerate(aParsedUrl) {
|
|
384
|
+
let url = '';
|
|
385
|
+
if (aParsedUrl.scheme) {
|
|
386
|
+
url += aParsedUrl.scheme + ':';
|
|
387
|
+
}
|
|
388
|
+
url += '//';
|
|
389
|
+
if (aParsedUrl.auth) {
|
|
390
|
+
url += aParsedUrl.auth + '@';
|
|
391
|
+
}
|
|
392
|
+
if (aParsedUrl.host) {
|
|
393
|
+
url += aParsedUrl.host;
|
|
394
|
+
}
|
|
395
|
+
if (aParsedUrl.port) {
|
|
396
|
+
url += ':' + aParsedUrl.port;
|
|
397
|
+
}
|
|
398
|
+
if (aParsedUrl.path) {
|
|
399
|
+
url += aParsedUrl.path;
|
|
400
|
+
}
|
|
401
|
+
return url
|
|
402
|
+
}
|
|
403
|
+
exports.urlGenerate = urlGenerate;
|
|
404
|
+
|
|
405
|
+
const MAX_CACHED_INPUTS = 32;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Takes some function `f(input) -> result` and returns a memoized version of
|
|
409
|
+
* `f`.
|
|
410
|
+
*
|
|
411
|
+
* We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
|
|
412
|
+
* memoization is a dumb-simple, linear least-recently-used cache.
|
|
413
|
+
*/
|
|
414
|
+
function lruMemoize(f) {
|
|
415
|
+
const cache = [];
|
|
416
|
+
|
|
417
|
+
return function (input) {
|
|
418
|
+
for (let i = 0; i < cache.length; i++) {
|
|
419
|
+
if (cache[i].input === input) {
|
|
420
|
+
const temp = cache[0];
|
|
421
|
+
cache[0] = cache[i];
|
|
422
|
+
cache[i] = temp;
|
|
423
|
+
return cache[0].result
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const result = f(input);
|
|
428
|
+
|
|
429
|
+
cache.unshift({
|
|
430
|
+
input,
|
|
431
|
+
result,
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
if (cache.length > MAX_CACHED_INPUTS) {
|
|
435
|
+
cache.pop();
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return result
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Normalizes a path, or the path portion of a URL:
|
|
444
|
+
*
|
|
445
|
+
* - Replaces consecutive slashes with one slash.
|
|
446
|
+
* - Removes unnecessary '.' parts.
|
|
447
|
+
* - Removes unnecessary '<dir>/..' parts.
|
|
448
|
+
*
|
|
449
|
+
* Based on code in the Node.js 'path' core module.
|
|
450
|
+
*
|
|
451
|
+
* @param aPath The path or url to normalize.
|
|
452
|
+
*/
|
|
453
|
+
const normalize = lruMemoize(function normalize(aPath) {
|
|
454
|
+
let path = aPath;
|
|
455
|
+
const url = urlParse(aPath);
|
|
456
|
+
if (url) {
|
|
457
|
+
if (!url.path) {
|
|
458
|
+
return aPath
|
|
459
|
+
}
|
|
460
|
+
path = url.path;
|
|
461
|
+
}
|
|
462
|
+
const isAbsolute = exports.isAbsolute(path);
|
|
463
|
+
|
|
464
|
+
// Split the path into parts between `/` characters. This is much faster than
|
|
465
|
+
// using `.split(/\/+/g)`.
|
|
466
|
+
const parts = [];
|
|
467
|
+
let start = 0;
|
|
468
|
+
let i = 0;
|
|
469
|
+
while (true) {
|
|
470
|
+
start = i;
|
|
471
|
+
i = path.indexOf('/', start);
|
|
472
|
+
if (i === -1) {
|
|
473
|
+
parts.push(path.slice(start));
|
|
474
|
+
break
|
|
475
|
+
} else {
|
|
476
|
+
parts.push(path.slice(start, i));
|
|
477
|
+
while (i < path.length && path[i] === '/') {
|
|
478
|
+
i++;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
let up = 0;
|
|
484
|
+
for (i = parts.length - 1; i >= 0; i--) {
|
|
485
|
+
const part = parts[i];
|
|
486
|
+
if (part === '.') {
|
|
487
|
+
parts.splice(i, 1);
|
|
488
|
+
} else if (part === '..') {
|
|
489
|
+
up++;
|
|
490
|
+
} else if (up > 0) {
|
|
491
|
+
if (part === '') {
|
|
492
|
+
// The first part is blank if the path is absolute. Trying to go
|
|
493
|
+
// above the root is a no-op. Therefore we can remove all '..' parts
|
|
494
|
+
// directly after the root.
|
|
495
|
+
parts.splice(i + 1, up);
|
|
496
|
+
up = 0;
|
|
497
|
+
} else {
|
|
498
|
+
parts.splice(i, 2);
|
|
499
|
+
up--;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
path = parts.join('/');
|
|
504
|
+
|
|
505
|
+
if (path === '') {
|
|
506
|
+
path = isAbsolute ? '/' : '.';
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (url) {
|
|
510
|
+
url.path = path;
|
|
511
|
+
return urlGenerate(url)
|
|
512
|
+
}
|
|
513
|
+
return path
|
|
514
|
+
});
|
|
515
|
+
exports.normalize = normalize;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Joins two paths/URLs.
|
|
519
|
+
*
|
|
520
|
+
* @param aRoot The root path or URL.
|
|
521
|
+
* @param aPath The path or URL to be joined with the root.
|
|
522
|
+
*
|
|
523
|
+
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
|
|
524
|
+
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
|
|
525
|
+
* first.
|
|
526
|
+
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
|
|
527
|
+
* is updated with the result and aRoot is returned. Otherwise the result
|
|
528
|
+
* is returned.
|
|
529
|
+
* - If aPath is absolute, the result is aPath.
|
|
530
|
+
* - Otherwise the two paths are joined with a slash.
|
|
531
|
+
* - Joining for example 'http://' and 'www.example.com' is also supported.
|
|
532
|
+
*/
|
|
533
|
+
function join(aRoot, aPath) {
|
|
534
|
+
if (aRoot === '') {
|
|
535
|
+
aRoot = '.';
|
|
536
|
+
}
|
|
537
|
+
if (aPath === '') {
|
|
538
|
+
aPath = '.';
|
|
539
|
+
}
|
|
540
|
+
const aPathUrl = urlParse(aPath);
|
|
541
|
+
const aRootUrl = urlParse(aRoot);
|
|
542
|
+
if (aRootUrl) {
|
|
543
|
+
aRoot = aRootUrl.path || '/';
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// `join(foo, '//www.example.org')`
|
|
547
|
+
if (aPathUrl && !aPathUrl.scheme) {
|
|
548
|
+
if (aRootUrl) {
|
|
549
|
+
aPathUrl.scheme = aRootUrl.scheme;
|
|
550
|
+
}
|
|
551
|
+
return urlGenerate(aPathUrl)
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
|
555
|
+
return aPath
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
// `join('http://', 'www.example.com')`
|
|
559
|
+
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
|
560
|
+
aRootUrl.host = aPath;
|
|
561
|
+
return urlGenerate(aRootUrl)
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const joined =
|
|
565
|
+
aPath.charAt(0) === '/'
|
|
566
|
+
? aPath
|
|
567
|
+
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
|
568
|
+
|
|
569
|
+
if (aRootUrl) {
|
|
570
|
+
aRootUrl.path = joined;
|
|
571
|
+
return urlGenerate(aRootUrl)
|
|
572
|
+
}
|
|
573
|
+
return joined
|
|
574
|
+
}
|
|
575
|
+
exports.join = join;
|
|
576
|
+
|
|
577
|
+
exports.isAbsolute = function (aPath) {
|
|
578
|
+
return aPath.charAt(0) === '/' || urlRegexp.test(aPath)
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Make a path relative to a URL or another path.
|
|
583
|
+
*
|
|
584
|
+
* @param aRoot The root path or URL.
|
|
585
|
+
* @param aPath The path or URL to be made relative to aRoot.
|
|
586
|
+
*/
|
|
587
|
+
function relative(aRoot, aPath) {
|
|
588
|
+
if (aRoot === '') {
|
|
589
|
+
aRoot = '.';
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
aRoot = aRoot.replace(/\/$/, '');
|
|
593
|
+
|
|
594
|
+
// It is possible for the path to be above the root. In this case, simply
|
|
595
|
+
// checking whether the root is a prefix of the path won't work. Instead, we
|
|
596
|
+
// need to remove components from the root one by one, until either we find
|
|
597
|
+
// a prefix that fits, or we run out of components to remove.
|
|
598
|
+
let level = 0;
|
|
599
|
+
while (aPath.indexOf(aRoot + '/') !== 0) {
|
|
600
|
+
const index = aRoot.lastIndexOf('/');
|
|
601
|
+
if (index < 0) {
|
|
602
|
+
return aPath
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
// If the only part of the root that is left is the scheme (i.e. http://,
|
|
606
|
+
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
|
|
607
|
+
// have exhausted all components, so the path is not relative to the root.
|
|
608
|
+
aRoot = aRoot.slice(0, index);
|
|
609
|
+
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
|
610
|
+
return aPath
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
++level;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// Make sure we add a "../" for each component we removed from the root.
|
|
617
|
+
return Array(level + 1).join('../') + aPath.substr(aRoot.length + 1)
|
|
618
|
+
}
|
|
619
|
+
exports.relative = relative;
|
|
620
|
+
|
|
621
|
+
const supportsNullProto = (function () {
|
|
622
|
+
const obj = Object.create(null);
|
|
623
|
+
return !('__proto__' in obj)
|
|
624
|
+
})();
|
|
625
|
+
|
|
626
|
+
function identity(s) {
|
|
627
|
+
return s
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Because behavior goes wacky when you set `__proto__` on objects, we
|
|
632
|
+
* have to prefix all the strings in our set with an arbitrary character.
|
|
633
|
+
*
|
|
634
|
+
* See https://github.com/mozilla/source-map/pull/31 and
|
|
635
|
+
* https://github.com/mozilla/source-map/issues/30
|
|
636
|
+
*
|
|
637
|
+
* @param String aStr
|
|
638
|
+
*/
|
|
639
|
+
function toSetString(aStr) {
|
|
640
|
+
if (isProtoString(aStr)) {
|
|
641
|
+
return '$' + aStr
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return aStr
|
|
645
|
+
}
|
|
646
|
+
exports.toSetString = supportsNullProto ? identity : toSetString;
|
|
647
|
+
|
|
648
|
+
function fromSetString(aStr) {
|
|
649
|
+
if (isProtoString(aStr)) {
|
|
650
|
+
return aStr.slice(1)
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
return aStr
|
|
654
|
+
}
|
|
655
|
+
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
656
|
+
|
|
657
|
+
function isProtoString(s) {
|
|
658
|
+
if (!s) {
|
|
659
|
+
return false
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const length = s.length;
|
|
663
|
+
|
|
664
|
+
if (length < 9 /* "__proto__".length */) {
|
|
665
|
+
return false
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/* eslint-disable no-multi-spaces */
|
|
669
|
+
if (
|
|
670
|
+
s.charCodeAt(length - 1) !== 95 /* '_' */ ||
|
|
671
|
+
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
|
|
672
|
+
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
|
|
673
|
+
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
|
|
674
|
+
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
|
|
675
|
+
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
|
|
676
|
+
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
|
|
677
|
+
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
|
|
678
|
+
s.charCodeAt(length - 9) !== 95 /* '_' */
|
|
679
|
+
) {
|
|
680
|
+
return false
|
|
681
|
+
}
|
|
682
|
+
/* eslint-enable no-multi-spaces */
|
|
683
|
+
|
|
684
|
+
for (let i = length - 10; i >= 0; i--) {
|
|
685
|
+
if (s.charCodeAt(i) !== 36 /* '$' */) {
|
|
686
|
+
return false
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
return true
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Comparator between two mappings where the original positions are compared.
|
|
695
|
+
*
|
|
696
|
+
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
|
697
|
+
* mappings with the same original source/line/column, but different generated
|
|
698
|
+
* line and column the same. Useful when searching for a mapping with a
|
|
699
|
+
* stubbed out mapping.
|
|
700
|
+
*/
|
|
701
|
+
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
702
|
+
let cmp = strcmp(mappingA.source, mappingB.source);
|
|
703
|
+
if (cmp !== 0) {
|
|
704
|
+
return cmp
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
708
|
+
if (cmp !== 0) {
|
|
709
|
+
return cmp
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
713
|
+
if (cmp !== 0 || onlyCompareOriginal) {
|
|
714
|
+
return cmp
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
718
|
+
if (cmp !== 0) {
|
|
719
|
+
return cmp
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
723
|
+
if (cmp !== 0) {
|
|
724
|
+
return cmp
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
return strcmp(mappingA.name, mappingB.name)
|
|
728
|
+
}
|
|
729
|
+
exports.compareByOriginalPositions = compareByOriginalPositions;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Comparator between two mappings with deflated source and name indices where
|
|
733
|
+
* the generated positions are compared.
|
|
734
|
+
*
|
|
735
|
+
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
|
736
|
+
* mappings with the same generated line and column, but different
|
|
737
|
+
* source/name/original line and column the same. Useful when searching for a
|
|
738
|
+
* mapping with a stubbed out mapping.
|
|
739
|
+
*/
|
|
740
|
+
function compareByGeneratedPositionsDeflated(
|
|
741
|
+
mappingA,
|
|
742
|
+
mappingB,
|
|
743
|
+
onlyCompareGenerated
|
|
744
|
+
) {
|
|
745
|
+
let cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
746
|
+
if (cmp !== 0) {
|
|
747
|
+
return cmp
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
751
|
+
if (cmp !== 0 || onlyCompareGenerated) {
|
|
752
|
+
return cmp
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
cmp = strcmp(mappingA.source, mappingB.source);
|
|
756
|
+
if (cmp !== 0) {
|
|
757
|
+
return cmp
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
761
|
+
if (cmp !== 0) {
|
|
762
|
+
return cmp
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
766
|
+
if (cmp !== 0) {
|
|
767
|
+
return cmp
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
return strcmp(mappingA.name, mappingB.name)
|
|
771
|
+
}
|
|
772
|
+
exports.compareByGeneratedPositionsDeflated =
|
|
773
|
+
compareByGeneratedPositionsDeflated;
|
|
774
|
+
|
|
775
|
+
function strcmp(aStr1, aStr2) {
|
|
776
|
+
if (aStr1 === aStr2) {
|
|
777
|
+
return 0
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (aStr1 === null) {
|
|
781
|
+
return 1 // aStr2 !== null
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
if (aStr2 === null) {
|
|
785
|
+
return -1 // aStr1 !== null
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
if (aStr1 > aStr2) {
|
|
789
|
+
return 1
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return -1
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Comparator between two mappings with inflated source and name strings where
|
|
797
|
+
* the generated positions are compared.
|
|
798
|
+
*/
|
|
799
|
+
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
800
|
+
let cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
801
|
+
if (cmp !== 0) {
|
|
802
|
+
return cmp
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
806
|
+
if (cmp !== 0) {
|
|
807
|
+
return cmp
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
cmp = strcmp(mappingA.source, mappingB.source);
|
|
811
|
+
if (cmp !== 0) {
|
|
812
|
+
return cmp
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
816
|
+
if (cmp !== 0) {
|
|
817
|
+
return cmp
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
821
|
+
if (cmp !== 0) {
|
|
822
|
+
return cmp
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
return strcmp(mappingA.name, mappingB.name)
|
|
826
|
+
}
|
|
827
|
+
exports.compareByGeneratedPositionsInflated =
|
|
828
|
+
compareByGeneratedPositionsInflated;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Strip any JSON XSSI avoidance prefix from the string (as documented
|
|
832
|
+
* in the source maps specification), and then parse the string as
|
|
833
|
+
* JSON.
|
|
834
|
+
*/
|
|
835
|
+
function parseSourceMapInput(str) {
|
|
836
|
+
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''))
|
|
837
|
+
}
|
|
838
|
+
exports.parseSourceMapInput = parseSourceMapInput;
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* Compute the URL of a source given the the source root, the source's
|
|
842
|
+
* URL, and the source map's URL.
|
|
843
|
+
*/
|
|
844
|
+
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
845
|
+
sourceURL = sourceURL || '';
|
|
846
|
+
|
|
847
|
+
if (sourceRoot) {
|
|
848
|
+
// This follows what Chrome does.
|
|
849
|
+
if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
|
|
850
|
+
sourceRoot += '/';
|
|
851
|
+
}
|
|
852
|
+
// The spec says:
|
|
853
|
+
// Line 4: An optional source root, useful for relocating source
|
|
854
|
+
// files on a server or removing repeated values in the
|
|
855
|
+
// “sources” entry. This value is prepended to the individual
|
|
856
|
+
// entries in the “source” field.
|
|
857
|
+
sourceURL = sourceRoot + sourceURL;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
// Historically, SourceMapConsumer did not take the sourceMapURL as
|
|
861
|
+
// a parameter. This mode is still somewhat supported, which is why
|
|
862
|
+
// this code block is conditional. However, it's preferable to pass
|
|
863
|
+
// the source map URL to SourceMapConsumer, so that this function
|
|
864
|
+
// can implement the source URL resolution algorithm as outlined in
|
|
865
|
+
// the spec. This block is basically the equivalent of:
|
|
866
|
+
// new URL(sourceURL, sourceMapURL).toString()
|
|
867
|
+
// ... except it avoids using URL, which wasn't available in the
|
|
868
|
+
// older releases of node still supported by this library.
|
|
869
|
+
//
|
|
870
|
+
// The spec says:
|
|
871
|
+
// If the sources are not absolute URLs after prepending of the
|
|
872
|
+
// “sourceRoot”, the sources are resolved relative to the
|
|
873
|
+
// SourceMap (like resolving script src in a html document).
|
|
874
|
+
if (sourceMapURL) {
|
|
875
|
+
const parsed = urlParse(sourceMapURL);
|
|
876
|
+
if (!parsed) {
|
|
877
|
+
throw new Error('sourceMapURL could not be parsed')
|
|
878
|
+
}
|
|
879
|
+
if (parsed.path) {
|
|
880
|
+
// Strip the last path component, but keep the "/".
|
|
881
|
+
const index = parsed.path.lastIndexOf('/');
|
|
882
|
+
if (index >= 0) {
|
|
883
|
+
parsed.path = parsed.path.substring(0, index + 1);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
sourceURL = join(urlGenerate(parsed), sourceURL);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
return normalize(sourceURL)
|
|
890
|
+
}
|
|
891
|
+
exports.computeSourceURL = computeSourceURL;
|
|
892
|
+
} (util$4));
|
|
893
|
+
|
|
894
|
+
var arraySet = {};
|
|
901
895
|
|
|
902
896
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
897
|
+
|
|
903
898
|
/*
|
|
904
899
|
* Copyright 2011 Mozilla Foundation and contributors
|
|
905
900
|
* Licensed under the New BSD license. See LICENSE or:
|
|
@@ -912,7 +907,7 @@ exports.computeSourceURL = computeSourceURL;
|
|
|
912
907
|
* element is O(1). Removing elements from the set is not supported. Only
|
|
913
908
|
* strings are supported for membership.
|
|
914
909
|
*/
|
|
915
|
-
|
|
910
|
+
let ArraySet$2 = class ArraySet {
|
|
916
911
|
constructor() {
|
|
917
912
|
this._array = [];
|
|
918
913
|
this._set = new Map();
|
|
@@ -997,14 +992,10 @@ class ArraySet$2 {
|
|
|
997
992
|
toArray() {
|
|
998
993
|
return this._array.slice()
|
|
999
994
|
}
|
|
1000
|
-
}
|
|
1001
|
-
var ArraySet_1 = ArraySet$2;
|
|
1002
|
-
|
|
1003
|
-
var arraySet = {
|
|
1004
|
-
ArraySet: ArraySet_1
|
|
1005
995
|
};
|
|
996
|
+
arraySet.ArraySet = ArraySet$2;
|
|
1006
997
|
|
|
1007
|
-
var
|
|
998
|
+
var mappingList = {};
|
|
1008
999
|
|
|
1009
1000
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
1010
1001
|
|
|
@@ -1014,7 +1005,7 @@ var util = util$1;
|
|
|
1014
1005
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
1015
1006
|
*/
|
|
1016
1007
|
|
|
1017
|
-
|
|
1008
|
+
const util$3 = util$4;
|
|
1018
1009
|
|
|
1019
1010
|
/**
|
|
1020
1011
|
* Determine whether mappingB is after mappingA with respect to generated
|
|
@@ -1029,7 +1020,7 @@ function generatedPositionAfter(mappingA, mappingB) {
|
|
|
1029
1020
|
return (
|
|
1030
1021
|
lineB > lineA ||
|
|
1031
1022
|
(lineB == lineA && columnB >= columnA) ||
|
|
1032
|
-
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0
|
|
1023
|
+
util$3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0
|
|
1033
1024
|
)
|
|
1034
1025
|
}
|
|
1035
1026
|
|
|
@@ -1038,7 +1029,7 @@ function generatedPositionAfter(mappingA, mappingB) {
|
|
|
1038
1029
|
* performance conscious manner. It trades a negligible overhead in general
|
|
1039
1030
|
* case for a large speedup in case of mappings being added in order.
|
|
1040
1031
|
*/
|
|
1041
|
-
|
|
1032
|
+
let MappingList$1 = class MappingList {
|
|
1042
1033
|
constructor() {
|
|
1043
1034
|
this._array = [];
|
|
1044
1035
|
this._sorted = true;
|
|
@@ -1082,24 +1073,14 @@ class MappingList$1 {
|
|
|
1082
1073
|
*/
|
|
1083
1074
|
toArray() {
|
|
1084
1075
|
if (!this._sorted) {
|
|
1085
|
-
this._array.sort(util.compareByGeneratedPositionsInflated);
|
|
1076
|
+
this._array.sort(util$3.compareByGeneratedPositionsInflated);
|
|
1086
1077
|
this._sorted = true;
|
|
1087
1078
|
}
|
|
1088
1079
|
return this._array
|
|
1089
1080
|
}
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
var MappingList_1 = MappingList$1;
|
|
1093
|
-
|
|
1094
|
-
var mappingList = {
|
|
1095
|
-
MappingList: MappingList_1
|
|
1096
1081
|
};
|
|
1097
1082
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
var require$$0$1 = arraySet;
|
|
1101
|
-
|
|
1102
|
-
var require$$1$1 = mappingList;
|
|
1083
|
+
mappingList.MappingList = MappingList$1;
|
|
1103
1084
|
|
|
1104
1085
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
1105
1086
|
|
|
@@ -1109,10 +1090,10 @@ var require$$1$1 = mappingList;
|
|
|
1109
1090
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
1110
1091
|
*/
|
|
1111
1092
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
const ArraySet$1 =
|
|
1115
|
-
const MappingList =
|
|
1093
|
+
const base64VLQ = base64Vlq;
|
|
1094
|
+
const util$2 = util$4;
|
|
1095
|
+
const ArraySet$1 = arraySet.ArraySet;
|
|
1096
|
+
const MappingList = mappingList.MappingList;
|
|
1116
1097
|
|
|
1117
1098
|
/**
|
|
1118
1099
|
* An instance of the SourceMapGenerator represents a source map which is
|
|
@@ -1122,14 +1103,14 @@ const MappingList = require$$1$1.MappingList;
|
|
|
1122
1103
|
* - file: The filename of the generated source.
|
|
1123
1104
|
* - sourceRoot: A root for all relative URLs in this source map.
|
|
1124
1105
|
*/
|
|
1125
|
-
|
|
1106
|
+
let SourceMapGenerator$1 = class SourceMapGenerator {
|
|
1126
1107
|
constructor(aArgs) {
|
|
1127
1108
|
if (!aArgs) {
|
|
1128
1109
|
aArgs = {};
|
|
1129
1110
|
}
|
|
1130
|
-
this._file = util.getArg(aArgs, 'file', null);
|
|
1131
|
-
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
|
1132
|
-
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
|
1111
|
+
this._file = util$2.getArg(aArgs, 'file', null);
|
|
1112
|
+
this._sourceRoot = util$2.getArg(aArgs, 'sourceRoot', null);
|
|
1113
|
+
this._skipValidation = util$2.getArg(aArgs, 'skipValidation', false);
|
|
1133
1114
|
this._sources = new ArraySet$1();
|
|
1134
1115
|
this._names = new ArraySet$1();
|
|
1135
1116
|
this._mappings = new MappingList();
|
|
@@ -1158,7 +1139,7 @@ class SourceMapGenerator$1 {
|
|
|
1158
1139
|
if (mapping.source != null) {
|
|
1159
1140
|
newMapping.source = mapping.source;
|
|
1160
1141
|
if (sourceRoot != null) {
|
|
1161
|
-
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
|
1142
|
+
newMapping.source = util$2.relative(sourceRoot, newMapping.source);
|
|
1162
1143
|
}
|
|
1163
1144
|
|
|
1164
1145
|
newMapping.original = {
|
|
@@ -1176,7 +1157,7 @@ class SourceMapGenerator$1 {
|
|
|
1176
1157
|
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
|
1177
1158
|
let sourceRelative = sourceFile;
|
|
1178
1159
|
if (sourceRoot !== null) {
|
|
1179
|
-
sourceRelative = util.relative(sourceRoot, sourceFile);
|
|
1160
|
+
sourceRelative = util$2.relative(sourceRoot, sourceFile);
|
|
1180
1161
|
}
|
|
1181
1162
|
|
|
1182
1163
|
if (!generator._sources.has(sourceRelative)) {
|
|
@@ -1202,10 +1183,10 @@ class SourceMapGenerator$1 {
|
|
|
1202
1183
|
* - name: An optional original token name for this mapping.
|
|
1203
1184
|
*/
|
|
1204
1185
|
addMapping(aArgs) {
|
|
1205
|
-
const generated = util.getArg(aArgs, 'generated');
|
|
1206
|
-
const original = util.getArg(aArgs, 'original', null);
|
|
1207
|
-
let source = util.getArg(aArgs, 'source', null);
|
|
1208
|
-
let name = util.getArg(aArgs, 'name', null);
|
|
1186
|
+
const generated = util$2.getArg(aArgs, 'generated');
|
|
1187
|
+
const original = util$2.getArg(aArgs, 'original', null);
|
|
1188
|
+
let source = util$2.getArg(aArgs, 'source', null);
|
|
1189
|
+
let name = util$2.getArg(aArgs, 'name', null);
|
|
1209
1190
|
|
|
1210
1191
|
if (!this._skipValidation) {
|
|
1211
1192
|
this._validateMapping(generated, original, source, name);
|
|
@@ -1241,7 +1222,7 @@ class SourceMapGenerator$1 {
|
|
|
1241
1222
|
setSourceContent(aSourceFile, aSourceContent) {
|
|
1242
1223
|
let source = aSourceFile;
|
|
1243
1224
|
if (this._sourceRoot != null) {
|
|
1244
|
-
source = util.relative(this._sourceRoot, source);
|
|
1225
|
+
source = util$2.relative(this._sourceRoot, source);
|
|
1245
1226
|
}
|
|
1246
1227
|
|
|
1247
1228
|
if (aSourceContent != null) {
|
|
@@ -1250,11 +1231,11 @@ class SourceMapGenerator$1 {
|
|
|
1250
1231
|
if (!this._sourcesContents) {
|
|
1251
1232
|
this._sourcesContents = Object.create(null);
|
|
1252
1233
|
}
|
|
1253
|
-
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
|
1234
|
+
this._sourcesContents[util$2.toSetString(source)] = aSourceContent;
|
|
1254
1235
|
} else if (this._sourcesContents) {
|
|
1255
1236
|
// Remove the source file from the _sourcesContents map.
|
|
1256
1237
|
// If the _sourcesContents map is empty, set the property to null.
|
|
1257
|
-
delete this._sourcesContents[util.toSetString(source)];
|
|
1238
|
+
delete this._sourcesContents[util$2.toSetString(source)];
|
|
1258
1239
|
if (Object.keys(this._sourcesContents).length === 0) {
|
|
1259
1240
|
this._sourcesContents = null;
|
|
1260
1241
|
}
|
|
@@ -1292,7 +1273,7 @@ class SourceMapGenerator$1 {
|
|
|
1292
1273
|
const sourceRoot = this._sourceRoot;
|
|
1293
1274
|
// Make "sourceFile" relative if an absolute Url is passed.
|
|
1294
1275
|
if (sourceRoot != null) {
|
|
1295
|
-
sourceFile = util.relative(sourceRoot, sourceFile);
|
|
1276
|
+
sourceFile = util$2.relative(sourceRoot, sourceFile);
|
|
1296
1277
|
}
|
|
1297
1278
|
// Applying the SourceMap can add and remove items from the sources and
|
|
1298
1279
|
// the names array.
|
|
@@ -1312,10 +1293,10 @@ class SourceMapGenerator$1 {
|
|
|
1312
1293
|
// Copy mapping
|
|
1313
1294
|
mapping.source = original.source;
|
|
1314
1295
|
if (aSourceMapPath != null) {
|
|
1315
|
-
mapping.source = util.join(aSourceMapPath, mapping.source);
|
|
1296
|
+
mapping.source = util$2.join(aSourceMapPath, mapping.source);
|
|
1316
1297
|
}
|
|
1317
1298
|
if (sourceRoot != null) {
|
|
1318
|
-
mapping.source = util.relative(sourceRoot, mapping.source);
|
|
1299
|
+
mapping.source = util$2.relative(sourceRoot, mapping.source);
|
|
1319
1300
|
}
|
|
1320
1301
|
mapping.originalLine = original.line;
|
|
1321
1302
|
mapping.originalColumn = original.column;
|
|
@@ -1343,10 +1324,10 @@ class SourceMapGenerator$1 {
|
|
|
1343
1324
|
const content = aSourceMapConsumer.sourceContentFor(srcFile);
|
|
1344
1325
|
if (content != null) {
|
|
1345
1326
|
if (aSourceMapPath != null) {
|
|
1346
|
-
srcFile = util.join(aSourceMapPath, srcFile);
|
|
1327
|
+
srcFile = util$2.join(aSourceMapPath, srcFile);
|
|
1347
1328
|
}
|
|
1348
1329
|
if (sourceRoot != null) {
|
|
1349
|
-
srcFile = util.relative(sourceRoot, srcFile);
|
|
1330
|
+
srcFile = util$2.relative(sourceRoot, srcFile);
|
|
1350
1331
|
}
|
|
1351
1332
|
this.setSourceContent(srcFile, content);
|
|
1352
1333
|
}
|
|
@@ -1445,7 +1426,7 @@ class SourceMapGenerator$1 {
|
|
|
1445
1426
|
}
|
|
1446
1427
|
} else if (i > 0) {
|
|
1447
1428
|
if (
|
|
1448
|
-
!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])
|
|
1429
|
+
!util$2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])
|
|
1449
1430
|
) {
|
|
1450
1431
|
continue
|
|
1451
1432
|
}
|
|
@@ -1492,9 +1473,9 @@ class SourceMapGenerator$1 {
|
|
|
1492
1473
|
return null
|
|
1493
1474
|
}
|
|
1494
1475
|
if (aSourceRoot != null) {
|
|
1495
|
-
source = util.relative(aSourceRoot, source);
|
|
1476
|
+
source = util$2.relative(aSourceRoot, source);
|
|
1496
1477
|
}
|
|
1497
|
-
const key = util.toSetString(source);
|
|
1478
|
+
const key = util$2.toSetString(source);
|
|
1498
1479
|
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
|
|
1499
1480
|
? this._sourcesContents[key]
|
|
1500
1481
|
: null
|
|
@@ -1533,141 +1514,145 @@ class SourceMapGenerator$1 {
|
|
|
1533
1514
|
toString() {
|
|
1534
1515
|
return JSON.stringify(this.toJSON())
|
|
1535
1516
|
}
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
SourceMapGenerator$1.prototype._version = 3;
|
|
1539
|
-
var SourceMapGenerator_1 = SourceMapGenerator$1;
|
|
1540
|
-
|
|
1541
|
-
var sourceMapGenerator = {
|
|
1542
|
-
SourceMapGenerator: SourceMapGenerator_1
|
|
1543
1517
|
};
|
|
1544
1518
|
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
var binarySearch$1 = createCommonjsModule(function (module, exports) {
|
|
1548
|
-
/*
|
|
1549
|
-
* Copyright 2011 Mozilla Foundation and contributors
|
|
1550
|
-
* Licensed under the New BSD license. See LICENSE or:
|
|
1551
|
-
* http://opensource.org/licenses/BSD-3-Clause
|
|
1552
|
-
*/
|
|
1553
|
-
|
|
1554
|
-
exports.GREATEST_LOWER_BOUND = 1;
|
|
1555
|
-
exports.LEAST_UPPER_BOUND = 2;
|
|
1556
|
-
|
|
1557
|
-
/**
|
|
1558
|
-
* Recursive implementation of binary search.
|
|
1559
|
-
*
|
|
1560
|
-
* @param aLow Indices here and lower do not contain the needle.
|
|
1561
|
-
* @param aHigh Indices here and higher do not contain the needle.
|
|
1562
|
-
* @param aNeedle The element being searched for.
|
|
1563
|
-
* @param aHaystack The non-empty array being searched.
|
|
1564
|
-
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
|
1565
|
-
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
|
1566
|
-
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
|
1567
|
-
* closest element that is smaller than or greater than the one we are
|
|
1568
|
-
* searching for, respectively, if the exact element cannot be found.
|
|
1569
|
-
*/
|
|
1570
|
-
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
1571
|
-
// This function terminates when one of the following is true:
|
|
1572
|
-
//
|
|
1573
|
-
// 1. We find the exact element we are looking for.
|
|
1574
|
-
//
|
|
1575
|
-
// 2. We did not find the exact element, but we can return the index of
|
|
1576
|
-
// the next-closest element.
|
|
1577
|
-
//
|
|
1578
|
-
// 3. We did not find the exact element, and there is no next-closest
|
|
1579
|
-
// element than the one we are searching for, so we return -1.
|
|
1580
|
-
const mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
1581
|
-
const cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
1582
|
-
if (cmp === 0) {
|
|
1583
|
-
// Found the element we are looking for.
|
|
1584
|
-
return mid
|
|
1585
|
-
} else if (cmp > 0) {
|
|
1586
|
-
// Our needle is greater than aHaystack[mid].
|
|
1587
|
-
if (aHigh - mid > 1) {
|
|
1588
|
-
// The element is in the upper half.
|
|
1589
|
-
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias)
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
// The exact needle element was not found in this haystack. Determine if
|
|
1593
|
-
// we are in termination case (3) or (2) and return the appropriate thing.
|
|
1594
|
-
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
1595
|
-
return aHigh < aHaystack.length ? aHigh : -1
|
|
1596
|
-
}
|
|
1597
|
-
return mid
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
// Our needle is less than aHaystack[mid].
|
|
1601
|
-
if (mid - aLow > 1) {
|
|
1602
|
-
// The element is in the lower half.
|
|
1603
|
-
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias)
|
|
1604
|
-
}
|
|
1519
|
+
SourceMapGenerator$1.prototype._version = 3;
|
|
1520
|
+
sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
|
|
1605
1521
|
|
|
1606
|
-
|
|
1607
|
-
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
1608
|
-
return mid
|
|
1609
|
-
}
|
|
1610
|
-
return aLow < 0 ? -1 : aLow
|
|
1611
|
-
}
|
|
1522
|
+
var sourceMapConsumer = {};
|
|
1612
1523
|
|
|
1613
|
-
|
|
1614
|
-
* This is an implementation of binary search which will always try and return
|
|
1615
|
-
* the index of the closest element if there is no exact hit. This is because
|
|
1616
|
-
* mappings between original and generated line/col pairs are single points,
|
|
1617
|
-
* and there is an implicit region between each of them, so a miss just means
|
|
1618
|
-
* that you aren't on the very start of a region.
|
|
1619
|
-
*
|
|
1620
|
-
* @param aNeedle The element you are looking for.
|
|
1621
|
-
* @param aHaystack The array that is being searched.
|
|
1622
|
-
* @param aCompare A function which takes the needle and an element in the
|
|
1623
|
-
* array and returns -1, 0, or 1 depending on whether the needle is less
|
|
1624
|
-
* than, equal to, or greater than the element, respectively.
|
|
1625
|
-
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
|
1626
|
-
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
|
1627
|
-
* closest element that is smaller than or greater than the one we are
|
|
1628
|
-
* searching for, respectively, if the exact element cannot be found.
|
|
1629
|
-
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
|
1630
|
-
*/
|
|
1631
|
-
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
1632
|
-
if (aHaystack.length === 0) {
|
|
1633
|
-
return -1
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
let index = recursiveSearch(
|
|
1637
|
-
-1,
|
|
1638
|
-
aHaystack.length,
|
|
1639
|
-
aNeedle,
|
|
1640
|
-
aHaystack,
|
|
1641
|
-
aCompare,
|
|
1642
|
-
aBias || exports.GREATEST_LOWER_BOUND
|
|
1643
|
-
);
|
|
1644
|
-
if (index < 0) {
|
|
1645
|
-
return -1
|
|
1646
|
-
}
|
|
1524
|
+
var binarySearch$1 = {};
|
|
1647
1525
|
|
|
1648
|
-
|
|
1649
|
-
// the one we are searching for. However, there may be more than one such
|
|
1650
|
-
// element. Make sure we always return the smallest of these.
|
|
1651
|
-
while (index - 1 >= 0) {
|
|
1652
|
-
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
|
1653
|
-
break
|
|
1654
|
-
}
|
|
1655
|
-
--index;
|
|
1656
|
-
}
|
|
1526
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
1657
1527
|
|
|
1658
|
-
|
|
1528
|
+
(function (exports) {
|
|
1529
|
+
/*
|
|
1530
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
1531
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
1532
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
1533
|
+
*/
|
|
1534
|
+
|
|
1535
|
+
exports.GREATEST_LOWER_BOUND = 1;
|
|
1536
|
+
exports.LEAST_UPPER_BOUND = 2;
|
|
1537
|
+
|
|
1538
|
+
/**
|
|
1539
|
+
* Recursive implementation of binary search.
|
|
1540
|
+
*
|
|
1541
|
+
* @param aLow Indices here and lower do not contain the needle.
|
|
1542
|
+
* @param aHigh Indices here and higher do not contain the needle.
|
|
1543
|
+
* @param aNeedle The element being searched for.
|
|
1544
|
+
* @param aHaystack The non-empty array being searched.
|
|
1545
|
+
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
|
1546
|
+
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
|
1547
|
+
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
|
1548
|
+
* closest element that is smaller than or greater than the one we are
|
|
1549
|
+
* searching for, respectively, if the exact element cannot be found.
|
|
1550
|
+
*/
|
|
1551
|
+
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
1552
|
+
// This function terminates when one of the following is true:
|
|
1553
|
+
//
|
|
1554
|
+
// 1. We find the exact element we are looking for.
|
|
1555
|
+
//
|
|
1556
|
+
// 2. We did not find the exact element, but we can return the index of
|
|
1557
|
+
// the next-closest element.
|
|
1558
|
+
//
|
|
1559
|
+
// 3. We did not find the exact element, and there is no next-closest
|
|
1560
|
+
// element than the one we are searching for, so we return -1.
|
|
1561
|
+
const mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
1562
|
+
const cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
1563
|
+
if (cmp === 0) {
|
|
1564
|
+
// Found the element we are looking for.
|
|
1565
|
+
return mid
|
|
1566
|
+
} else if (cmp > 0) {
|
|
1567
|
+
// Our needle is greater than aHaystack[mid].
|
|
1568
|
+
if (aHigh - mid > 1) {
|
|
1569
|
+
// The element is in the upper half.
|
|
1570
|
+
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias)
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
// The exact needle element was not found in this haystack. Determine if
|
|
1574
|
+
// we are in termination case (3) or (2) and return the appropriate thing.
|
|
1575
|
+
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
1576
|
+
return aHigh < aHaystack.length ? aHigh : -1
|
|
1577
|
+
}
|
|
1578
|
+
return mid
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
// Our needle is less than aHaystack[mid].
|
|
1582
|
+
if (mid - aLow > 1) {
|
|
1583
|
+
// The element is in the lower half.
|
|
1584
|
+
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias)
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
// we are in termination case (3) or (2) and return the appropriate thing.
|
|
1588
|
+
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
1589
|
+
return mid
|
|
1590
|
+
}
|
|
1591
|
+
return aLow < 0 ? -1 : aLow
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* This is an implementation of binary search which will always try and return
|
|
1596
|
+
* the index of the closest element if there is no exact hit. This is because
|
|
1597
|
+
* mappings between original and generated line/col pairs are single points,
|
|
1598
|
+
* and there is an implicit region between each of them, so a miss just means
|
|
1599
|
+
* that you aren't on the very start of a region.
|
|
1600
|
+
*
|
|
1601
|
+
* @param aNeedle The element you are looking for.
|
|
1602
|
+
* @param aHaystack The array that is being searched.
|
|
1603
|
+
* @param aCompare A function which takes the needle and an element in the
|
|
1604
|
+
* array and returns -1, 0, or 1 depending on whether the needle is less
|
|
1605
|
+
* than, equal to, or greater than the element, respectively.
|
|
1606
|
+
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
|
1607
|
+
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
|
1608
|
+
* closest element that is smaller than or greater than the one we are
|
|
1609
|
+
* searching for, respectively, if the exact element cannot be found.
|
|
1610
|
+
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
|
1611
|
+
*/
|
|
1612
|
+
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
1613
|
+
if (aHaystack.length === 0) {
|
|
1614
|
+
return -1
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
let index = recursiveSearch(
|
|
1618
|
+
-1,
|
|
1619
|
+
aHaystack.length,
|
|
1620
|
+
aNeedle,
|
|
1621
|
+
aHaystack,
|
|
1622
|
+
aCompare,
|
|
1623
|
+
aBias || exports.GREATEST_LOWER_BOUND
|
|
1624
|
+
);
|
|
1625
|
+
if (index < 0) {
|
|
1626
|
+
return -1
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
// We have found either the exact element, or the next-closest element than
|
|
1630
|
+
// the one we are searching for. However, there may be more than one such
|
|
1631
|
+
// element. Make sure we always return the smallest of these.
|
|
1632
|
+
while (index - 1 >= 0) {
|
|
1633
|
+
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
|
1634
|
+
break
|
|
1635
|
+
}
|
|
1636
|
+
--index;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
return index
|
|
1640
|
+
};
|
|
1641
|
+
} (binarySearch$1));
|
|
1642
|
+
|
|
1643
|
+
var readWasmExports = {};
|
|
1644
|
+
var readWasm$2 = {
|
|
1645
|
+
get exports(){ return readWasmExports; },
|
|
1646
|
+
set exports(v){ readWasmExports = v; },
|
|
1659
1647
|
};
|
|
1660
|
-
});
|
|
1661
1648
|
|
|
1662
1649
|
/* Determine browser vs node environment by testing the default top level context. Solution courtesy of: https://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser */
|
|
1663
|
-
|
|
1664
|
-
var readWasm$1 = createCommonjsModule(function (module) {
|
|
1665
1650
|
{
|
|
1666
1651
|
// Node version of reading a wasm file into an array buffer.
|
|
1667
|
-
const fs = fs__default
|
|
1668
|
-
const path = path__default
|
|
1652
|
+
const fs = fs__default.default;
|
|
1653
|
+
const path = path__default.default;
|
|
1669
1654
|
|
|
1670
|
-
|
|
1655
|
+
readWasm$2.exports = function readWasm() {
|
|
1671
1656
|
return new Promise((resolve, reject) => {
|
|
1672
1657
|
const wasmPath = path.join(
|
|
1673
1658
|
__dirname,
|
|
@@ -1685,15 +1670,14 @@ var readWasm$1 = createCommonjsModule(function (module) {
|
|
|
1685
1670
|
})
|
|
1686
1671
|
};
|
|
1687
1672
|
|
|
1688
|
-
|
|
1673
|
+
readWasmExports.initialize = (_) => {
|
|
1689
1674
|
console.debug(
|
|
1690
1675
|
'SourceMapConsumer.initialize is a no-op when running in node.js'
|
|
1691
1676
|
);
|
|
1692
1677
|
};
|
|
1693
1678
|
}
|
|
1694
|
-
});
|
|
1695
1679
|
|
|
1696
|
-
|
|
1680
|
+
const readWasm$1 = readWasmExports;
|
|
1697
1681
|
|
|
1698
1682
|
/**
|
|
1699
1683
|
* Provide the JIT with a nice shape / hidden class.
|
|
@@ -1717,7 +1701,7 @@ var wasm$1 = function wasm() {
|
|
|
1717
1701
|
|
|
1718
1702
|
const callbackStack = [];
|
|
1719
1703
|
|
|
1720
|
-
cachedWasm = readWasm()
|
|
1704
|
+
cachedWasm = readWasm$1()
|
|
1721
1705
|
.then((buffer) => {
|
|
1722
1706
|
return WebAssembly.instantiate(buffer, {
|
|
1723
1707
|
env: {
|
|
@@ -1832,10 +1816,6 @@ var wasm$1 = function wasm() {
|
|
|
1832
1816
|
return cachedWasm
|
|
1833
1817
|
};
|
|
1834
1818
|
|
|
1835
|
-
var binarySearch = binarySearch$1;
|
|
1836
|
-
|
|
1837
|
-
var wasm = wasm$1;
|
|
1838
|
-
|
|
1839
1819
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
1840
1820
|
|
|
1841
1821
|
/*
|
|
@@ -1844,16 +1824,15 @@ var wasm = wasm$1;
|
|
|
1844
1824
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
1845
1825
|
*/
|
|
1846
1826
|
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
const ArraySet =
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1827
|
+
const util$1 = util$4;
|
|
1828
|
+
const binarySearch = binarySearch$1;
|
|
1829
|
+
const ArraySet = arraySet.ArraySet;
|
|
1830
|
+
const readWasm = readWasmExports;
|
|
1831
|
+
const wasm = wasm$1;
|
|
1853
1832
|
|
|
1854
1833
|
const INTERNAL = Symbol('smcInternal');
|
|
1855
1834
|
|
|
1856
|
-
|
|
1835
|
+
let SourceMapConsumer$1 = class SourceMapConsumer {
|
|
1857
1836
|
constructor(aSourceMap, aSourceMapURL) {
|
|
1858
1837
|
// If the constructor was called by super(), just return Promise<this>.
|
|
1859
1838
|
// Yes, this is a hack to retain the pre-existing API of the base-class
|
|
@@ -1970,7 +1949,7 @@ class SourceMapConsumer$1 {
|
|
|
1970
1949
|
destroy() {
|
|
1971
1950
|
throw new Error('Subclasses must implement destroy')
|
|
1972
1951
|
}
|
|
1973
|
-
}
|
|
1952
|
+
};
|
|
1974
1953
|
|
|
1975
1954
|
/**
|
|
1976
1955
|
* The version of the source mapping spec that we are consuming.
|
|
@@ -1982,7 +1961,7 @@ SourceMapConsumer$1.ORIGINAL_ORDER = 2;
|
|
|
1982
1961
|
SourceMapConsumer$1.GREATEST_LOWER_BOUND = 1;
|
|
1983
1962
|
SourceMapConsumer$1.LEAST_UPPER_BOUND = 2;
|
|
1984
1963
|
|
|
1985
|
-
|
|
1964
|
+
sourceMapConsumer.SourceMapConsumer = SourceMapConsumer$1;
|
|
1986
1965
|
|
|
1987
1966
|
/**
|
|
1988
1967
|
* A BasicSourceMapConsumer instance represents a parsed source map which we can
|
|
@@ -2023,18 +2002,18 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2023
2002
|
return super(INTERNAL).then((that) => {
|
|
2024
2003
|
let sourceMap = aSourceMap;
|
|
2025
2004
|
if (typeof aSourceMap === 'string') {
|
|
2026
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
2005
|
+
sourceMap = util$1.parseSourceMapInput(aSourceMap);
|
|
2027
2006
|
}
|
|
2028
2007
|
|
|
2029
|
-
const version = util.getArg(sourceMap, 'version');
|
|
2030
|
-
let sources = util.getArg(sourceMap, 'sources');
|
|
2008
|
+
const version = util$1.getArg(sourceMap, 'version');
|
|
2009
|
+
let sources = util$1.getArg(sourceMap, 'sources');
|
|
2031
2010
|
// Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
|
|
2032
2011
|
// requires the array) to play nice here.
|
|
2033
|
-
const names = util.getArg(sourceMap, 'names', []);
|
|
2034
|
-
let sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
|
|
2035
|
-
const sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
|
|
2036
|
-
const mappings = util.getArg(sourceMap, 'mappings');
|
|
2037
|
-
const file = util.getArg(sourceMap, 'file', null);
|
|
2012
|
+
const names = util$1.getArg(sourceMap, 'names', []);
|
|
2013
|
+
let sourceRoot = util$1.getArg(sourceMap, 'sourceRoot', null);
|
|
2014
|
+
const sourcesContent = util$1.getArg(sourceMap, 'sourcesContent', null);
|
|
2015
|
+
const mappings = util$1.getArg(sourceMap, 'mappings');
|
|
2016
|
+
const file = util$1.getArg(sourceMap, 'file', null);
|
|
2038
2017
|
|
|
2039
2018
|
// Once again, Sass deviates from the spec and supplies the version as a
|
|
2040
2019
|
// string rather than a number, so we use loose equality checking here.
|
|
@@ -2043,7 +2022,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2043
2022
|
}
|
|
2044
2023
|
|
|
2045
2024
|
if (sourceRoot) {
|
|
2046
|
-
sourceRoot = util.normalize(sourceRoot);
|
|
2025
|
+
sourceRoot = util$1.normalize(sourceRoot);
|
|
2047
2026
|
}
|
|
2048
2027
|
|
|
2049
2028
|
sources = sources
|
|
@@ -2051,16 +2030,16 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2051
2030
|
// Some source maps produce relative source paths like "./foo.js" instead of
|
|
2052
2031
|
// "foo.js". Normalize these first so that future comparisons will succeed.
|
|
2053
2032
|
// See bugzil.la/1090768.
|
|
2054
|
-
.map(util.normalize)
|
|
2033
|
+
.map(util$1.normalize)
|
|
2055
2034
|
// Always ensure that absolute sources are internally stored relative to
|
|
2056
2035
|
// the source root, if the source root is absolute. Not doing this would
|
|
2057
2036
|
// be particularly problematic when the source root is a prefix of the
|
|
2058
2037
|
// source (valid, but why??). See github issue #199 and bugzil.la/1188982.
|
|
2059
2038
|
.map(function (source) {
|
|
2060
2039
|
return sourceRoot &&
|
|
2061
|
-
util.isAbsolute(sourceRoot) &&
|
|
2062
|
-
util.isAbsolute(source)
|
|
2063
|
-
? util.relative(sourceRoot, source)
|
|
2040
|
+
util$1.isAbsolute(sourceRoot) &&
|
|
2041
|
+
util$1.isAbsolute(source)
|
|
2042
|
+
? util$1.relative(sourceRoot, source)
|
|
2064
2043
|
: source
|
|
2065
2044
|
});
|
|
2066
2045
|
|
|
@@ -2072,7 +2051,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2072
2051
|
that._sources = ArraySet.fromArray(sources, true);
|
|
2073
2052
|
|
|
2074
2053
|
that._absoluteSources = that._sources.toArray().map(function (s) {
|
|
2075
|
-
return util.computeSourceURL(sourceRoot, s, aSourceMapURL)
|
|
2054
|
+
return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL)
|
|
2076
2055
|
});
|
|
2077
2056
|
|
|
2078
2057
|
that.sourceRoot = sourceRoot;
|
|
@@ -2099,7 +2078,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2099
2078
|
_findSourceIndex(aSource) {
|
|
2100
2079
|
let relativeSource = aSource;
|
|
2101
2080
|
if (this.sourceRoot != null) {
|
|
2102
|
-
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
2081
|
+
relativeSource = util$1.relative(this.sourceRoot, relativeSource);
|
|
2103
2082
|
}
|
|
2104
2083
|
|
|
2105
2084
|
if (this._sources.has(relativeSource)) {
|
|
@@ -2201,7 +2180,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2201
2180
|
(mapping) => {
|
|
2202
2181
|
if (mapping.source !== null) {
|
|
2203
2182
|
mapping.source = this._sources.at(mapping.source);
|
|
2204
|
-
mapping.source = util.computeSourceURL(
|
|
2183
|
+
mapping.source = util$1.computeSourceURL(
|
|
2205
2184
|
sourceRoot,
|
|
2206
2185
|
mapping.source,
|
|
2207
2186
|
this._sourceMapURL
|
|
@@ -2230,8 +2209,8 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2230
2209
|
}
|
|
2231
2210
|
|
|
2232
2211
|
allGeneratedPositionsFor(aArgs) {
|
|
2233
|
-
let source = util.getArg(aArgs, 'source');
|
|
2234
|
-
const originalLine = util.getArg(aArgs, 'line');
|
|
2212
|
+
let source = util$1.getArg(aArgs, 'source');
|
|
2213
|
+
const originalLine = util$1.getArg(aArgs, 'line');
|
|
2235
2214
|
const originalColumn = aArgs.column || 0;
|
|
2236
2215
|
|
|
2237
2216
|
source = this._findSourceIndex(source);
|
|
@@ -2321,8 +2300,8 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2321
2300
|
*/
|
|
2322
2301
|
originalPositionFor(aArgs) {
|
|
2323
2302
|
const needle = {
|
|
2324
|
-
generatedLine: util.getArg(aArgs, 'line'),
|
|
2325
|
-
generatedColumn: util.getArg(aArgs, 'column'),
|
|
2303
|
+
generatedLine: util$1.getArg(aArgs, 'line'),
|
|
2304
|
+
generatedColumn: util$1.getArg(aArgs, 'column'),
|
|
2326
2305
|
};
|
|
2327
2306
|
|
|
2328
2307
|
if (needle.generatedLine < 1) {
|
|
@@ -2333,7 +2312,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2333
2312
|
throw new Error('Column numbers must be >= 0')
|
|
2334
2313
|
}
|
|
2335
2314
|
|
|
2336
|
-
let bias = util.getArg(
|
|
2315
|
+
let bias = util$1.getArg(
|
|
2337
2316
|
aArgs,
|
|
2338
2317
|
'bias',
|
|
2339
2318
|
SourceMapConsumer$1.GREATEST_LOWER_BOUND
|
|
@@ -2357,25 +2336,25 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2357
2336
|
|
|
2358
2337
|
if (mapping) {
|
|
2359
2338
|
if (mapping.generatedLine === needle.generatedLine) {
|
|
2360
|
-
let source = util.getArg(mapping, 'source', null);
|
|
2339
|
+
let source = util$1.getArg(mapping, 'source', null);
|
|
2361
2340
|
if (source !== null) {
|
|
2362
2341
|
source = this._sources.at(source);
|
|
2363
|
-
source = util.computeSourceURL(
|
|
2342
|
+
source = util$1.computeSourceURL(
|
|
2364
2343
|
this.sourceRoot,
|
|
2365
2344
|
source,
|
|
2366
2345
|
this._sourceMapURL
|
|
2367
2346
|
);
|
|
2368
2347
|
}
|
|
2369
2348
|
|
|
2370
|
-
let name = util.getArg(mapping, 'name', null);
|
|
2349
|
+
let name = util$1.getArg(mapping, 'name', null);
|
|
2371
2350
|
if (name !== null) {
|
|
2372
2351
|
name = this._names.at(name);
|
|
2373
2352
|
}
|
|
2374
2353
|
|
|
2375
2354
|
return {
|
|
2376
2355
|
source,
|
|
2377
|
-
line: util.getArg(mapping, 'originalLine', null),
|
|
2378
|
-
column: util.getArg(mapping, 'originalColumn', null),
|
|
2356
|
+
line: util$1.getArg(mapping, 'originalLine', null),
|
|
2357
|
+
column: util$1.getArg(mapping, 'originalColumn', null),
|
|
2379
2358
|
name,
|
|
2380
2359
|
}
|
|
2381
2360
|
}
|
|
@@ -2422,11 +2401,11 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2422
2401
|
|
|
2423
2402
|
let relativeSource = aSource;
|
|
2424
2403
|
if (this.sourceRoot != null) {
|
|
2425
|
-
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
2404
|
+
relativeSource = util$1.relative(this.sourceRoot, relativeSource);
|
|
2426
2405
|
}
|
|
2427
2406
|
|
|
2428
2407
|
let url;
|
|
2429
|
-
if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
|
|
2408
|
+
if (this.sourceRoot != null && (url = util$1.urlParse(this.sourceRoot))) {
|
|
2430
2409
|
// XXX: file:// URIs and absolute paths lead to unexpected behavior for
|
|
2431
2410
|
// many users. We can help them out when they expect file:// URIs to
|
|
2432
2411
|
// behave like it would if they were running a local HTTP server. See
|
|
@@ -2479,7 +2458,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2479
2458
|
* The column number is 0-based.
|
|
2480
2459
|
*/
|
|
2481
2460
|
generatedPositionFor(aArgs) {
|
|
2482
|
-
let source = util.getArg(aArgs, 'source');
|
|
2461
|
+
let source = util$1.getArg(aArgs, 'source');
|
|
2483
2462
|
source = this._findSourceIndex(source);
|
|
2484
2463
|
if (source < 0) {
|
|
2485
2464
|
return {
|
|
@@ -2491,8 +2470,8 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2491
2470
|
|
|
2492
2471
|
const needle = {
|
|
2493
2472
|
source,
|
|
2494
|
-
originalLine: util.getArg(aArgs, 'line'),
|
|
2495
|
-
originalColumn: util.getArg(aArgs, 'column'),
|
|
2473
|
+
originalLine: util$1.getArg(aArgs, 'line'),
|
|
2474
|
+
originalColumn: util$1.getArg(aArgs, 'column'),
|
|
2496
2475
|
};
|
|
2497
2476
|
|
|
2498
2477
|
if (needle.originalLine < 1) {
|
|
@@ -2503,7 +2482,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2503
2482
|
throw new Error('Column numbers must be >= 0')
|
|
2504
2483
|
}
|
|
2505
2484
|
|
|
2506
|
-
let bias = util.getArg(
|
|
2485
|
+
let bias = util$1.getArg(
|
|
2507
2486
|
aArgs,
|
|
2508
2487
|
'bias',
|
|
2509
2488
|
SourceMapConsumer$1.GREATEST_LOWER_BOUND
|
|
@@ -2533,8 +2512,8 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2533
2512
|
lastColumn = Infinity;
|
|
2534
2513
|
}
|
|
2535
2514
|
return {
|
|
2536
|
-
line: util.getArg(mapping, 'generatedLine', null),
|
|
2537
|
-
column: util.getArg(mapping, 'generatedColumn', null),
|
|
2515
|
+
line: util$1.getArg(mapping, 'generatedLine', null),
|
|
2516
|
+
column: util$1.getArg(mapping, 'generatedColumn', null),
|
|
2538
2517
|
lastColumn,
|
|
2539
2518
|
}
|
|
2540
2519
|
}
|
|
@@ -2549,7 +2528,7 @@ class BasicSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2549
2528
|
}
|
|
2550
2529
|
|
|
2551
2530
|
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$1;
|
|
2552
|
-
|
|
2531
|
+
sourceMapConsumer.BasicSourceMapConsumer = BasicSourceMapConsumer;
|
|
2553
2532
|
|
|
2554
2533
|
/**
|
|
2555
2534
|
* An IndexedSourceMapConsumer instance represents a parsed source map which
|
|
@@ -2605,11 +2584,11 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2605
2584
|
return super(INTERNAL).then((that) => {
|
|
2606
2585
|
let sourceMap = aSourceMap;
|
|
2607
2586
|
if (typeof aSourceMap === 'string') {
|
|
2608
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
2587
|
+
sourceMap = util$1.parseSourceMapInput(aSourceMap);
|
|
2609
2588
|
}
|
|
2610
2589
|
|
|
2611
|
-
const version = util.getArg(sourceMap, 'version');
|
|
2612
|
-
const sections = util.getArg(sourceMap, 'sections');
|
|
2590
|
+
const version = util$1.getArg(sourceMap, 'version');
|
|
2591
|
+
const sections = util$1.getArg(sourceMap, 'sections');
|
|
2613
2592
|
|
|
2614
2593
|
if (version != that._version) {
|
|
2615
2594
|
throw new Error('Unsupported version: ' + version)
|
|
@@ -2635,9 +2614,9 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2635
2614
|
'Support for url field in sections not implemented.'
|
|
2636
2615
|
)
|
|
2637
2616
|
}
|
|
2638
|
-
const offset = util.getArg(s, 'offset');
|
|
2639
|
-
const offsetLine = util.getArg(offset, 'line');
|
|
2640
|
-
const offsetColumn = util.getArg(offset, 'column');
|
|
2617
|
+
const offset = util$1.getArg(s, 'offset');
|
|
2618
|
+
const offsetLine = util$1.getArg(offset, 'line');
|
|
2619
|
+
const offsetColumn = util$1.getArg(offset, 'column');
|
|
2641
2620
|
|
|
2642
2621
|
if (
|
|
2643
2622
|
offsetLine < lastOffset.line ||
|
|
@@ -2650,7 +2629,7 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2650
2629
|
lastOffset = offset;
|
|
2651
2630
|
|
|
2652
2631
|
const cons = new SourceMapConsumer$1(
|
|
2653
|
-
util.getArg(s, 'map'),
|
|
2632
|
+
util$1.getArg(s, 'map'),
|
|
2654
2633
|
aSourceMapURL
|
|
2655
2634
|
);
|
|
2656
2635
|
return cons.then((consumer) => {
|
|
@@ -2735,13 +2714,13 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2735
2714
|
|
|
2736
2715
|
_sortGeneratedMappings() {
|
|
2737
2716
|
const mappings = this._generatedMappingsUnsorted;
|
|
2738
|
-
mappings.sort(util.compareByGeneratedPositionsDeflated);
|
|
2717
|
+
mappings.sort(util$1.compareByGeneratedPositionsDeflated);
|
|
2739
2718
|
this.__generatedMappings = mappings;
|
|
2740
2719
|
}
|
|
2741
2720
|
|
|
2742
2721
|
_sortOriginalMappings() {
|
|
2743
2722
|
const mappings = this._originalMappingsUnsorted;
|
|
2744
|
-
mappings.sort(util.compareByOriginalPositions);
|
|
2723
|
+
mappings.sort(util$1.compareByOriginalPositions);
|
|
2745
2724
|
this.__originalMappings = mappings;
|
|
2746
2725
|
}
|
|
2747
2726
|
|
|
@@ -2779,8 +2758,8 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2779
2758
|
*/
|
|
2780
2759
|
originalPositionFor(aArgs) {
|
|
2781
2760
|
const needle = {
|
|
2782
|
-
generatedLine: util.getArg(aArgs, 'line'),
|
|
2783
|
-
generatedColumn: util.getArg(aArgs, 'column'),
|
|
2761
|
+
generatedLine: util$1.getArg(aArgs, 'line'),
|
|
2762
|
+
generatedColumn: util$1.getArg(aArgs, 'column'),
|
|
2784
2763
|
};
|
|
2785
2764
|
|
|
2786
2765
|
// Find the section containing the generated position we're trying to map
|
|
@@ -2875,7 +2854,7 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2875
2854
|
// Only consider this section if the requested source is in the list of
|
|
2876
2855
|
// sources of the consumer.
|
|
2877
2856
|
if (
|
|
2878
|
-
section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1
|
|
2857
|
+
section.consumer._findSourceIndex(util$1.getArg(aArgs, 'source')) === -1
|
|
2879
2858
|
) {
|
|
2880
2859
|
continue
|
|
2881
2860
|
}
|
|
@@ -2922,7 +2901,7 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2922
2901
|
// `source`, which would actually have gotten used as null because
|
|
2923
2902
|
// var's get hoisted.
|
|
2924
2903
|
// See: https://github.com/mozilla/source-map/issues/333
|
|
2925
|
-
let source = util.computeSourceURL(
|
|
2904
|
+
let source = util$1.computeSourceURL(
|
|
2926
2905
|
section.consumer.sourceRoot,
|
|
2927
2906
|
null,
|
|
2928
2907
|
this._sourceMapURL
|
|
@@ -2984,7 +2963,7 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
2984
2963
|
let source = null;
|
|
2985
2964
|
if (mapping.source !== null) {
|
|
2986
2965
|
source = this._sources.at(mapping.source);
|
|
2987
|
-
source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
|
|
2966
|
+
source = util$1.computeSourceURL(sourceRoot, source, this._sourceMapURL);
|
|
2988
2967
|
}
|
|
2989
2968
|
return {
|
|
2990
2969
|
source,
|
|
@@ -3023,16 +3002,16 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
3023
3002
|
}
|
|
3024
3003
|
|
|
3025
3004
|
allGeneratedPositionsFor(aArgs) {
|
|
3026
|
-
const line = util.getArg(aArgs, 'line');
|
|
3005
|
+
const line = util$1.getArg(aArgs, 'line');
|
|
3027
3006
|
|
|
3028
3007
|
// When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
|
|
3029
3008
|
// returns the index of the closest mapping less than the needle. By
|
|
3030
3009
|
// setting needle.originalColumn to 0, we thus find the last mapping for
|
|
3031
3010
|
// the given line, provided such a mapping exists.
|
|
3032
3011
|
const needle = {
|
|
3033
|
-
source: util.getArg(aArgs, 'source'),
|
|
3012
|
+
source: util$1.getArg(aArgs, 'source'),
|
|
3034
3013
|
originalLine: line,
|
|
3035
|
-
originalColumn: util.getArg(aArgs, 'column', 0),
|
|
3014
|
+
originalColumn: util$1.getArg(aArgs, 'column', 0),
|
|
3036
3015
|
};
|
|
3037
3016
|
|
|
3038
3017
|
needle.source = this._findSourceIndex(needle.source);
|
|
@@ -3055,7 +3034,7 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
3055
3034
|
this._originalMappings,
|
|
3056
3035
|
'originalLine',
|
|
3057
3036
|
'originalColumn',
|
|
3058
|
-
util.compareByOriginalPositions,
|
|
3037
|
+
util$1.compareByOriginalPositions,
|
|
3059
3038
|
binarySearch.LEAST_UPPER_BOUND
|
|
3060
3039
|
);
|
|
3061
3040
|
if (index >= 0) {
|
|
@@ -3074,8 +3053,8 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
3074
3053
|
lastColumn = Infinity;
|
|
3075
3054
|
}
|
|
3076
3055
|
mappings.push({
|
|
3077
|
-
line: util.getArg(mapping, 'generatedLine', null),
|
|
3078
|
-
column: util.getArg(mapping, 'generatedColumn', null),
|
|
3056
|
+
line: util$1.getArg(mapping, 'generatedLine', null),
|
|
3057
|
+
column: util$1.getArg(mapping, 'generatedColumn', null),
|
|
3079
3058
|
lastColumn,
|
|
3080
3059
|
});
|
|
3081
3060
|
|
|
@@ -3098,8 +3077,8 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
3098
3077
|
lastColumn = Infinity;
|
|
3099
3078
|
}
|
|
3100
3079
|
mappings.push({
|
|
3101
|
-
line: util.getArg(mapping, 'generatedLine', null),
|
|
3102
|
-
column: util.getArg(mapping, 'generatedColumn', null),
|
|
3080
|
+
line: util$1.getArg(mapping, 'generatedLine', null),
|
|
3081
|
+
column: util$1.getArg(mapping, 'generatedColumn', null),
|
|
3103
3082
|
lastColumn,
|
|
3104
3083
|
});
|
|
3105
3084
|
|
|
@@ -3117,7 +3096,7 @@ class IndexedSourceMapConsumer extends SourceMapConsumer$1 {
|
|
|
3117
3096
|
}
|
|
3118
3097
|
}
|
|
3119
3098
|
}
|
|
3120
|
-
|
|
3099
|
+
sourceMapConsumer.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
3121
3100
|
|
|
3122
3101
|
/*
|
|
3123
3102
|
* Cheat to get around inter-twingled classes. `factory()` can be at the end
|
|
@@ -3126,7 +3105,7 @@ var IndexedSourceMapConsumer_1 = IndexedSourceMapConsumer;
|
|
|
3126
3105
|
function _factory(aSourceMap, aSourceMapURL) {
|
|
3127
3106
|
let sourceMap = aSourceMap;
|
|
3128
3107
|
if (typeof aSourceMap === 'string') {
|
|
3129
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
3108
|
+
sourceMap = util$1.parseSourceMapInput(aSourceMap);
|
|
3130
3109
|
}
|
|
3131
3110
|
|
|
3132
3111
|
const consumer =
|
|
@@ -3140,13 +3119,7 @@ function _factoryBSM(aSourceMap, aSourceMapURL) {
|
|
|
3140
3119
|
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL)
|
|
3141
3120
|
}
|
|
3142
3121
|
|
|
3143
|
-
var
|
|
3144
|
-
SourceMapConsumer: SourceMapConsumer_1,
|
|
3145
|
-
BasicSourceMapConsumer: BasicSourceMapConsumer_1,
|
|
3146
|
-
IndexedSourceMapConsumer: IndexedSourceMapConsumer_1
|
|
3147
|
-
};
|
|
3148
|
-
|
|
3149
|
-
var require$$0 = sourceMapGenerator;
|
|
3122
|
+
var sourceNode = {};
|
|
3150
3123
|
|
|
3151
3124
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
3152
3125
|
|
|
@@ -3156,8 +3129,8 @@ var require$$0 = sourceMapGenerator;
|
|
|
3156
3129
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
3157
3130
|
*/
|
|
3158
3131
|
|
|
3159
|
-
const SourceMapGenerator =
|
|
3160
|
-
|
|
3132
|
+
const SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
|
|
3133
|
+
const util = util$4;
|
|
3161
3134
|
|
|
3162
3135
|
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
|
3163
3136
|
// operating systems these days (capturing the result).
|
|
@@ -3578,15 +3551,7 @@ class SourceNode {
|
|
|
3578
3551
|
}
|
|
3579
3552
|
}
|
|
3580
3553
|
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
var sourceNode = {
|
|
3584
|
-
SourceNode: SourceNode_1
|
|
3585
|
-
};
|
|
3586
|
-
|
|
3587
|
-
var require$$1 = sourceMapConsumer;
|
|
3588
|
-
|
|
3589
|
-
var require$$2 = sourceNode;
|
|
3554
|
+
sourceNode.SourceNode = SourceNode;
|
|
3590
3555
|
|
|
3591
3556
|
/*
|
|
3592
3557
|
* Copyright 2009-2011 Mozilla Foundation and contributors
|
|
@@ -3594,10 +3559,9 @@ var require$$2 = sourceNode;
|
|
|
3594
3559
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
3595
3560
|
*/
|
|
3596
3561
|
|
|
3597
|
-
|
|
3598
|
-
var SourceMapConsumer =
|
|
3599
|
-
|
|
3600
|
-
require$$2.SourceNode;
|
|
3562
|
+
sourceMapGenerator.SourceMapGenerator;
|
|
3563
|
+
var SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
|
|
3564
|
+
sourceNode.SourceNode;
|
|
3601
3565
|
|
|
3602
3566
|
const splitRE = /\r?\n/;
|
|
3603
3567
|
const range = 2;
|
|
@@ -3648,7 +3612,7 @@ function generateCodeFrame(source, start = 0, end) {
|
|
|
3648
3612
|
}
|
|
3649
3613
|
let isWindows = false;
|
|
3650
3614
|
try {
|
|
3651
|
-
isWindows = os__default
|
|
3615
|
+
isWindows = os__default.default.platform() === 'win32';
|
|
3652
3616
|
}
|
|
3653
3617
|
catch (error) { }
|
|
3654
3618
|
function normalizePath(id) {
|
|
@@ -3670,7 +3634,7 @@ function generateCodeFrameSourceMapConsumer(consumer, m, options = {}) {
|
|
|
3670
3634
|
return {
|
|
3671
3635
|
type: m.type,
|
|
3672
3636
|
file: options.sourceRoot
|
|
3673
|
-
? normalizePath(path__default
|
|
3637
|
+
? normalizePath(path__default.default.relative(options.sourceRoot, res.source.replace('\\\\?\\', '')))
|
|
3674
3638
|
: res.source,
|
|
3675
3639
|
line: res.line,
|
|
3676
3640
|
column: res.column,
|
|
@@ -3682,8 +3646,8 @@ function generateCodeFrameSourceMapConsumer(consumer, m, options = {}) {
|
|
|
3682
3646
|
}
|
|
3683
3647
|
}
|
|
3684
3648
|
function initConsumer(filename) {
|
|
3685
|
-
if (fs__default
|
|
3686
|
-
return new SourceMapConsumer(fs__default
|
|
3649
|
+
if (fs__default.default.existsSync(filename)) {
|
|
3650
|
+
return new SourceMapConsumer(fs__default.default.readFileSync(filename, 'utf8'));
|
|
3687
3651
|
}
|
|
3688
3652
|
return Promise.resolve(undefined);
|
|
3689
3653
|
}
|
|
@@ -3717,8 +3681,8 @@ function generateCodeFrameWithSourceMapPath(filename, messages, options = {}) {
|
|
|
3717
3681
|
return Promise.resolve([]);
|
|
3718
3682
|
}
|
|
3719
3683
|
function resolveSourceMapPath(sourceMapFilename, name, outputDir) {
|
|
3720
|
-
const is_uni_modules = path__default
|
|
3721
|
-
return path__default
|
|
3684
|
+
const is_uni_modules = path__default.default.basename(path__default.default.dirname(name)) === 'uni_modules';
|
|
3685
|
+
return path__default.default.resolve(outputDir, '../.sourcemap/app', name, is_uni_modules ? 'utssdk' : '', sourceMapFilename);
|
|
3722
3686
|
}
|
|
3723
3687
|
function generateCodeFrameWithKotlinStacktrace(stacktrace, { name, inputDir, outputDir }) {
|
|
3724
3688
|
const sourceMapFilename = resolveSourceMapPath('app-android/index.kt.map', name, outputDir);
|
|
@@ -3890,7 +3854,7 @@ function getSourceMapContent(sourcemapUrl) {
|
|
|
3890
3854
|
});
|
|
3891
3855
|
}
|
|
3892
3856
|
else {
|
|
3893
|
-
sourcemapCatch[sourcemapUrl] = fs__default
|
|
3857
|
+
sourcemapCatch[sourcemapUrl] = fs__default.default.readFileSync(sourcemapUrl, 'utf-8');
|
|
3894
3858
|
resolve(sourcemapCatch[sourcemapUrl]);
|
|
3895
3859
|
}
|
|
3896
3860
|
}
|
|
@@ -4022,7 +3986,7 @@ function utsStracktraceyPreset(opts) {
|
|
|
4022
3986
|
let errStack = [];
|
|
4023
3987
|
return {
|
|
4024
3988
|
parseSourceMapUrl(file, fileName, fileRelative) {
|
|
4025
|
-
return path__default
|
|
3989
|
+
return path__default.default.resolve(sourceMapRoot, path__default.default.relative(outputRoot, file) + '.map');
|
|
4026
3990
|
},
|
|
4027
3991
|
getSourceMapContent(file, fileName, fileRelative) {
|
|
4028
3992
|
// 根据 base,filename 组合 sourceMapUrl
|
|
@@ -4070,7 +4034,7 @@ function utsStracktraceyPreset(opts) {
|
|
|
4070
4034
|
if (item === '%StacktraceyItem%') {
|
|
4071
4035
|
const _stack = stack.items.shift();
|
|
4072
4036
|
if (_stack) {
|
|
4073
|
-
return `at ${nixSlashes(path__default
|
|
4037
|
+
return `at ${nixSlashes(path__default.default.relative(inputRoot, _stack.file.replace('\\\\?\\', '')))}:${_stack.line}:${_stack.column}
|
|
4074
4038
|
${_stack.errMsg}`;
|
|
4075
4039
|
}
|
|
4076
4040
|
return '';
|