@magic-xpa/mscorelib 4.800.0-dev480.22 → 4.800.0-dev480.220
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/bundles/magic-xpa-mscorelib.umd.js +50 -164
- package/bundles/magic-xpa-mscorelib.umd.js.map +1 -1
- package/bundles/magic-xpa-mscorelib.umd.min.js +1 -1
- package/bundles/magic-xpa-mscorelib.umd.min.js.map +1 -1
- package/esm2015/index.js +1 -1
- package/esm2015/magic-xpa-mscorelib.js +1 -4
- package/esm2015/src/ApplicationException.js +1 -1
- package/esm2015/src/ArrayEnumerator.js +1 -1
- package/esm2015/src/BitArray.js +2 -22
- package/esm2015/src/Char.js +1 -1
- package/esm2015/src/CultureInfo.js +1 -1
- package/esm2015/src/DateTime.js +1 -6
- package/esm2015/src/Debug.js +1 -1
- package/esm2015/src/Dictionary.js +1 -1
- package/esm2015/src/Encoding.js +44 -52
- package/esm2015/src/Exception.js +1 -14
- package/esm2015/src/HashTable.js +3 -20
- package/esm2015/src/IComparable.js +1 -1
- package/esm2015/src/ISO_8859_1_Encoding.js +1 -1
- package/esm2015/src/Int32.js +1 -1
- package/esm2015/src/Int64.js +1 -1
- package/esm2015/src/List.js +2 -6
- package/esm2015/src/NChar.js +1 -1
- package/esm2015/src/NNumber.js +2 -15
- package/esm2015/src/NString.js +2 -8
- package/esm2015/src/NotImplementedException.js +1 -1
- package/esm2015/src/NumberFormatInfo.js +2 -2
- package/esm2015/src/RefParam.js +1 -1
- package/esm2015/src/Stack.js +1 -1
- package/esm2015/src/StackFrame.js +1 -3
- package/esm2015/src/StackTrace.js +1 -6
- package/esm2015/src/StringBuilder.js +1 -15
- package/esm2015/src/StringUtils.js +1 -1
- package/esm2015/src/Thread.js +1 -5
- package/esm2015/src/WebException.js +1 -1
- package/esm2015/src/XmlConvert.js +1 -2
- package/fesm2015/magic-xpa-mscorelib.js +50 -164
- package/fesm2015/magic-xpa-mscorelib.js.map +1 -1
- package/magic-xpa-mscorelib.d.ts +0 -3
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ import { getSync } from 'stacktrace-js';
|
|
|
5
5
|
import { __awaiter } from 'tslib';
|
|
6
6
|
import { interval } from 'rxjs';
|
|
7
7
|
|
|
8
|
-
/// <summary>
|
|
9
8
|
class Exception {
|
|
10
9
|
constructor(messageOrError) {
|
|
11
10
|
this.name = "Exception";
|
|
@@ -23,25 +22,15 @@ class Exception {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
/// <summary>
|
|
27
|
-
/// get the message of exception
|
|
28
|
-
/// </summary>
|
|
29
25
|
get Message() {
|
|
30
26
|
return this.message;
|
|
31
27
|
}
|
|
32
|
-
/// <summary>
|
|
33
|
-
/// get the stack trace of exception
|
|
34
|
-
/// </summary>
|
|
35
28
|
get StackTrace() {
|
|
36
29
|
let stackTrace = this.stack || '';
|
|
37
30
|
let stackLines = stackTrace.split("\n").map(function (line) { return line.trim(); });
|
|
38
|
-
// On some browsers (e.g. Chrome), the statck includes a title as "Error", so remove it.
|
|
39
31
|
stackTrace = stackLines.splice(stackLines[0] === 'Error' ? this.errorLevel + 1 : this.errorLevel).join("\n");
|
|
40
32
|
return "\n" + stackTrace;
|
|
41
33
|
}
|
|
42
|
-
/// <summary>
|
|
43
|
-
/// get the type of exception
|
|
44
|
-
/// </summary>
|
|
45
34
|
GetType() {
|
|
46
35
|
return this.name;
|
|
47
36
|
}
|
|
@@ -73,40 +62,20 @@ class Array_Enumerator {
|
|
|
73
62
|
}
|
|
74
63
|
}
|
|
75
64
|
|
|
76
|
-
/// <summary>
|
|
77
|
-
/// Manages a compact array of bit values,
|
|
78
|
-
// which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).
|
|
79
|
-
/// </summary>
|
|
80
65
|
class BitArray {
|
|
81
66
|
constructor(length) {
|
|
82
|
-
this.array = null;
|
|
67
|
+
this.array = null;
|
|
83
68
|
this.array = new Array(length).fill(false);
|
|
84
69
|
}
|
|
85
|
-
/// <summary>
|
|
86
|
-
/// returns the length of array
|
|
87
|
-
/// </summary>
|
|
88
|
-
/// <returns></returns>
|
|
89
70
|
get Length() {
|
|
90
71
|
return this.array.length;
|
|
91
72
|
}
|
|
92
|
-
/// <summary>
|
|
93
|
-
/// get the value of flag at specified index
|
|
94
|
-
/// </summary>
|
|
95
|
-
/// <returns></returns>
|
|
96
73
|
Get(index) {
|
|
97
74
|
return this.array[index];
|
|
98
75
|
}
|
|
99
|
-
/// <summary>
|
|
100
|
-
/// set the value of flag at specified index
|
|
101
|
-
/// </summary>
|
|
102
|
-
/// <returns></returns>
|
|
103
76
|
Set(index, value) {
|
|
104
77
|
this.array[index] = value;
|
|
105
78
|
}
|
|
106
|
-
/// <summary>
|
|
107
|
-
/// set all the flags with specified value
|
|
108
|
-
/// </summary>
|
|
109
|
-
/// <returns></returns>
|
|
110
79
|
SetAll(value) {
|
|
111
80
|
this.array.forEach(x => {
|
|
112
81
|
x = value;
|
|
@@ -129,14 +98,11 @@ var DateTimeKind;
|
|
|
129
98
|
DateTimeKind[DateTimeKind["Local"] = 0] = "Local";
|
|
130
99
|
DateTimeKind[DateTimeKind["Utc"] = 1] = "Utc";
|
|
131
100
|
})(DateTimeKind || (DateTimeKind = {}));
|
|
132
|
-
// @dynamic
|
|
133
101
|
class DateTime {
|
|
134
102
|
constructor(yearOrDate, month, day, hour, minute, second) {
|
|
135
103
|
this.dt = null;
|
|
136
104
|
this.kind = null;
|
|
137
|
-
// the number of .net ticks at the unix epoch
|
|
138
105
|
this.epochTicks = 621355968000000000;
|
|
139
|
-
// there are 10000 .net ticks per millisecond
|
|
140
106
|
this.ticksPerMillisecond = 10000;
|
|
141
107
|
if (arguments.length === 1) {
|
|
142
108
|
this.dt = yearOrDate;
|
|
@@ -150,8 +116,6 @@ class DateTime {
|
|
|
150
116
|
this.kind = DateTimeKind.Local;
|
|
151
117
|
}
|
|
152
118
|
get Ticks() {
|
|
153
|
-
// https://stackoverflow.com/questions/7966559/how-to-convert-javascript-date-object-to-ticks
|
|
154
|
-
// TODO - check if we need this or to use Misc.getSystemMilliseconds()
|
|
155
119
|
return ((this.dt.getTime() * this.ticksPerMillisecond) + this.epochTicks) - (this.dt.getTimezoneOffset() * 600000000);
|
|
156
120
|
}
|
|
157
121
|
get Year() {
|
|
@@ -269,11 +233,6 @@ class Encoding {
|
|
|
269
233
|
bytes = this.textEncoder.encode(str);
|
|
270
234
|
}
|
|
271
235
|
catch (ex) {
|
|
272
|
-
// In C#, if any character is not within the range of specified charset, it is replaced by '?'.
|
|
273
|
-
// TextEncoder.encode() throws an error in such a case.
|
|
274
|
-
// We can modify the implementation of TextEncoder.encode() to put '?' instead of throwing error.
|
|
275
|
-
// But, it can be problematic if we change the library version.
|
|
276
|
-
// So, we will catch this error and handle the encoding ourselves.
|
|
277
236
|
bytes = new Uint8Array(str.length * 3);
|
|
278
237
|
let bytesCount = 0;
|
|
279
238
|
let tmpBytes;
|
|
@@ -292,7 +251,6 @@ class Encoding {
|
|
|
292
251
|
return bytes;
|
|
293
252
|
}
|
|
294
253
|
GetByteCount(str) {
|
|
295
|
-
// TODO: this is not the best way.
|
|
296
254
|
return this.GetBytes(str).length;
|
|
297
255
|
}
|
|
298
256
|
GetString(bytes, index, count) {
|
|
@@ -317,53 +275,51 @@ class Encoding {
|
|
|
317
275
|
}
|
|
318
276
|
static PopulateCodePageToEncodingMap() {
|
|
319
277
|
let hashTable = new Object;
|
|
320
|
-
|
|
321
|
-
hashTable[
|
|
322
|
-
hashTable[
|
|
323
|
-
hashTable[
|
|
324
|
-
hashTable[
|
|
325
|
-
hashTable[
|
|
326
|
-
hashTable[
|
|
327
|
-
hashTable[
|
|
328
|
-
hashTable[
|
|
329
|
-
hashTable[
|
|
330
|
-
hashTable[
|
|
331
|
-
hashTable[
|
|
332
|
-
hashTable[
|
|
333
|
-
hashTable[
|
|
334
|
-
hashTable[
|
|
335
|
-
hashTable[
|
|
336
|
-
hashTable[
|
|
337
|
-
hashTable[
|
|
338
|
-
hashTable[
|
|
339
|
-
hashTable[
|
|
340
|
-
hashTable[
|
|
341
|
-
hashTable[
|
|
342
|
-
hashTable[
|
|
343
|
-
hashTable[
|
|
344
|
-
hashTable[
|
|
345
|
-
hashTable[
|
|
346
|
-
hashTable[
|
|
347
|
-
hashTable[
|
|
348
|
-
hashTable[
|
|
349
|
-
hashTable[
|
|
350
|
-
hashTable[
|
|
351
|
-
hashTable[
|
|
352
|
-
hashTable[
|
|
353
|
-
hashTable[
|
|
354
|
-
hashTable[
|
|
355
|
-
hashTable[
|
|
356
|
-
hashTable[
|
|
357
|
-
hashTable[
|
|
358
|
-
hashTable[
|
|
359
|
-
hashTable[
|
|
360
|
-
hashTable[
|
|
361
|
-
hashTable[
|
|
362
|
-
hashTable[
|
|
363
|
-
hashTable[51932] = "x-euc"; // Japanese (EUC)
|
|
278
|
+
hashTable[20106] = "DIN_66003";
|
|
279
|
+
hashTable[20107] = "SEN_850200_B";
|
|
280
|
+
hashTable[50932] = "_autodetect";
|
|
281
|
+
hashTable[20108] = "NS_4551-1";
|
|
282
|
+
hashTable[50949] = "_autodetect_kr";
|
|
283
|
+
hashTable[950] = "big5";
|
|
284
|
+
hashTable[50221] = "csISO2022JP";
|
|
285
|
+
hashTable[51949] = "euc-kr";
|
|
286
|
+
hashTable[936] = "gb2312";
|
|
287
|
+
hashTable[52936] = "hz-gb-2312";
|
|
288
|
+
hashTable[852] = "ibm852";
|
|
289
|
+
hashTable[866] = "ibm866";
|
|
290
|
+
hashTable[20105] = "irv";
|
|
291
|
+
hashTable[50220] = "iso-2022-jp";
|
|
292
|
+
hashTable[50222] = "iso-2022-jp";
|
|
293
|
+
hashTable[50225] = "iso-2022-kr";
|
|
294
|
+
hashTable[28591] = "iso-8859-1";
|
|
295
|
+
hashTable[28592] = "iso-8859-2";
|
|
296
|
+
hashTable[28593] = "iso-8859-3";
|
|
297
|
+
hashTable[28594] = "iso-8859-4";
|
|
298
|
+
hashTable[28595] = "iso-8859-5";
|
|
299
|
+
hashTable[28596] = "iso-8859-6";
|
|
300
|
+
hashTable[28597] = "iso-8859-7";
|
|
301
|
+
hashTable[28598] = "iso-8859-8";
|
|
302
|
+
hashTable[20866] = "koi8-r";
|
|
303
|
+
hashTable[949] = "ks_c_5601";
|
|
304
|
+
hashTable[932] = "shift-jis";
|
|
305
|
+
hashTable[1200] = "unicode";
|
|
306
|
+
hashTable[1201] = "unicodeFEFF";
|
|
307
|
+
hashTable[65000] = "utf-7";
|
|
308
|
+
hashTable[65001] = "utf-8";
|
|
309
|
+
hashTable[1250] = "windows-1250";
|
|
310
|
+
hashTable[1251] = "windows-1251";
|
|
311
|
+
hashTable[1252] = "windows-1252";
|
|
312
|
+
hashTable[1253] = "windows-1253";
|
|
313
|
+
hashTable[1254] = "windows-1254";
|
|
314
|
+
hashTable[1255] = "windows-1255";
|
|
315
|
+
hashTable[1256] = "windows-1256";
|
|
316
|
+
hashTable[1257] = "windows-1257";
|
|
317
|
+
hashTable[1258] = "windows-1258";
|
|
318
|
+
hashTable[874] = "windows-874";
|
|
319
|
+
hashTable[20127] = "US-ASCII";
|
|
320
|
+
hashTable[51932] = "x-euc";
|
|
364
321
|
return hashTable;
|
|
365
322
|
}
|
|
366
|
-
// return the name of encoding used
|
|
367
323
|
toString() {
|
|
368
324
|
return this.label;
|
|
369
325
|
}
|
|
@@ -373,10 +329,7 @@ Encoding.UTF8 = new Encoding("utf-8");
|
|
|
373
329
|
Encoding.Unicode = new Encoding("utf-16le");
|
|
374
330
|
Encoding.CodePageToEncodingMap = Encoding.PopulateCodePageToEncodingMap();
|
|
375
331
|
|
|
376
|
-
// Reference: https://github.com/rkostrzewski/hashtable-ts/blob/master/src/hashtable.ts
|
|
377
332
|
class HashUtils {
|
|
378
|
-
// Pay attention that in server there is the same function and it must
|
|
379
|
-
// return the same hash value.
|
|
380
333
|
static GetHashCode(str) {
|
|
381
334
|
let bytes = null;
|
|
382
335
|
bytes = Encoding.UTF8.GetBytes(str);
|
|
@@ -403,11 +356,10 @@ class HashUtils {
|
|
|
403
356
|
}
|
|
404
357
|
}
|
|
405
358
|
const HashTableLoadFactor = 0.75;
|
|
406
|
-
// Hashtable implementation for key TKey and Value TValue
|
|
407
359
|
class Hashtable {
|
|
408
360
|
constructor(bucketCount = 8, loadFactor = HashTableLoadFactor) {
|
|
409
|
-
this._buckets = [];
|
|
410
|
-
this._elementsCount = 0;
|
|
361
|
+
this._buckets = [];
|
|
362
|
+
this._elementsCount = 0;
|
|
411
363
|
this._bucketCount = 0;
|
|
412
364
|
this._loadFactor = 0;
|
|
413
365
|
this._bucketCount = bucketCount;
|
|
@@ -416,7 +368,6 @@ class Hashtable {
|
|
|
416
368
|
throw new Exception('Bucket count must be a positive number and be multiple of 2.');
|
|
417
369
|
}
|
|
418
370
|
}
|
|
419
|
-
// Generic Hash funtion
|
|
420
371
|
HashFunction(key) {
|
|
421
372
|
if (typeof key.GetHashCode === 'function') {
|
|
422
373
|
return key.GetHashCode();
|
|
@@ -429,11 +380,9 @@ class Hashtable {
|
|
|
429
380
|
}
|
|
430
381
|
return 0;
|
|
431
382
|
}
|
|
432
|
-
// returns elementCount
|
|
433
383
|
get Count() {
|
|
434
384
|
return this._elementsCount;
|
|
435
385
|
}
|
|
436
|
-
// returns ValueCollection (Array Enumerator)
|
|
437
386
|
get Values() {
|
|
438
387
|
let array = [];
|
|
439
388
|
this._buckets.forEach(b => b.forEach(item => {
|
|
@@ -441,7 +390,6 @@ class Hashtable {
|
|
|
441
390
|
}));
|
|
442
391
|
return new Array_Enumerator(array);
|
|
443
392
|
}
|
|
444
|
-
// returns KeyCollection (Array Enumerator)
|
|
445
393
|
get Keys() {
|
|
446
394
|
let array = [];
|
|
447
395
|
this._buckets.forEach(b => b.forEach(item => {
|
|
@@ -449,15 +397,12 @@ class Hashtable {
|
|
|
449
397
|
}));
|
|
450
398
|
return new Array_Enumerator(array);
|
|
451
399
|
}
|
|
452
|
-
// adds item to Hashtable
|
|
453
400
|
Add(key, value) {
|
|
454
401
|
this.Insert(key, value, true);
|
|
455
402
|
}
|
|
456
|
-
// sets item in Hashtable
|
|
457
403
|
set_Item(key, value) {
|
|
458
404
|
this.Insert(key, value, false);
|
|
459
405
|
}
|
|
460
|
-
// Insert element in Hashtable
|
|
461
406
|
Insert(key, value, add) {
|
|
462
407
|
let bucketIndex = this.GetBucketIndex(key);
|
|
463
408
|
if (typeof this._buckets[bucketIndex] === "undefined") {
|
|
@@ -478,7 +423,6 @@ class Hashtable {
|
|
|
478
423
|
this.Resize(this._bucketCount * 2);
|
|
479
424
|
}
|
|
480
425
|
}
|
|
481
|
-
// Gets value for key TKey
|
|
482
426
|
get_Item(key) {
|
|
483
427
|
let bucketIndex = this.GetBucketIndex(key);
|
|
484
428
|
let bucket = this._buckets[bucketIndex];
|
|
@@ -491,7 +435,6 @@ class Hashtable {
|
|
|
491
435
|
}
|
|
492
436
|
return null;
|
|
493
437
|
}
|
|
494
|
-
// Returns if key TKey is present in Hashtable
|
|
495
438
|
ContainsKey(key) {
|
|
496
439
|
let bucketIndex = this.GetBucketIndex(key);
|
|
497
440
|
let bucket = this._buckets[bucketIndex];
|
|
@@ -501,7 +444,6 @@ class Hashtable {
|
|
|
501
444
|
let itemIndex = bucket.findIndex(x => x.key === key);
|
|
502
445
|
return (itemIndex > -1);
|
|
503
446
|
}
|
|
504
|
-
// Removes item with key TKey from Hashtable
|
|
505
447
|
Remove(key) {
|
|
506
448
|
let bucketIndex = this.GetBucketIndex(key);
|
|
507
449
|
let bucket = this._buckets[bucketIndex];
|
|
@@ -517,7 +459,6 @@ class Hashtable {
|
|
|
517
459
|
}
|
|
518
460
|
}
|
|
519
461
|
}
|
|
520
|
-
// Resize bucket (Hashtable)
|
|
521
462
|
Resize(newBucketCount) {
|
|
522
463
|
let _oldBuckets = this._buckets;
|
|
523
464
|
this._elementsCount = 0;
|
|
@@ -525,7 +466,6 @@ class Hashtable {
|
|
|
525
466
|
this._bucketCount = newBucketCount;
|
|
526
467
|
_oldBuckets.forEach(b => b.forEach(item => this.Add(item.key, item.value)));
|
|
527
468
|
}
|
|
528
|
-
// returns bucketIndex for key
|
|
529
469
|
GetBucketIndex(key) {
|
|
530
470
|
let hash = this.HashFunction(key);
|
|
531
471
|
if (hash % 1 !== 0) {
|
|
@@ -537,7 +477,6 @@ class Hashtable {
|
|
|
537
477
|
}
|
|
538
478
|
return index;
|
|
539
479
|
}
|
|
540
|
-
// Clears Hashtable
|
|
541
480
|
Clear() {
|
|
542
481
|
this._elementsCount = 0;
|
|
543
482
|
this._buckets = [];
|
|
@@ -640,7 +579,7 @@ class List extends Array {
|
|
|
640
579
|
Insert(index, item) {
|
|
641
580
|
if (index >= 0 && index < this.length)
|
|
642
581
|
this.splice(index, 0, item);
|
|
643
|
-
else if (index === this.length)
|
|
582
|
+
else if (index === this.length)
|
|
644
583
|
this.push(item);
|
|
645
584
|
else
|
|
646
585
|
throw new Error("index out of bounds");
|
|
@@ -667,10 +606,6 @@ class List extends Array {
|
|
|
667
606
|
foundItem = null;
|
|
668
607
|
return foundItem;
|
|
669
608
|
}
|
|
670
|
-
/// <summary>
|
|
671
|
-
/// add null cells up to 'size' cells.
|
|
672
|
-
/// </summary>
|
|
673
|
-
/// <param name="size"></param>
|
|
674
609
|
SetSize(size) {
|
|
675
610
|
if (this.length > size) {
|
|
676
611
|
this.RemoveRange(size, this.length - size);
|
|
@@ -792,11 +727,6 @@ var NumberStyles;
|
|
|
792
727
|
NumberStyles[NumberStyles["HexNumber"] = 0] = "HexNumber";
|
|
793
728
|
})(NumberStyles || (NumberStyles = {}));
|
|
794
729
|
class NNumber {
|
|
795
|
-
/// <summary>
|
|
796
|
-
/// convert a string to number
|
|
797
|
-
/// for blank string , it will return 0
|
|
798
|
-
/// for incorrect format it will return NaN
|
|
799
|
-
/// <summary>
|
|
800
730
|
static Parse(text, style) {
|
|
801
731
|
if (arguments.length === 2) {
|
|
802
732
|
if (style === NumberStyles.HexNumber)
|
|
@@ -804,20 +734,12 @@ class NNumber {
|
|
|
804
734
|
else
|
|
805
735
|
throw new NotImplementedException();
|
|
806
736
|
}
|
|
807
|
-
return +text;
|
|
737
|
+
return +text;
|
|
808
738
|
}
|
|
809
|
-
/// <summary>
|
|
810
|
-
/// convert a string to number
|
|
811
|
-
/// return true if string is correctly parsed i.e pvalue.value is number
|
|
812
|
-
/// for incorrect format it will return false
|
|
813
|
-
/// <summary>
|
|
814
739
|
static TryParse(str, pvalue) {
|
|
815
740
|
pvalue.value = +str;
|
|
816
741
|
return !isNaN(pvalue.value);
|
|
817
742
|
}
|
|
818
|
-
/// <summary>
|
|
819
|
-
/// convert a number to string with specified format
|
|
820
|
-
/// <summary>
|
|
821
743
|
static ToString(num, format) {
|
|
822
744
|
if (format === 'X2') {
|
|
823
745
|
let res = num.toString(16);
|
|
@@ -827,7 +749,6 @@ class NNumber {
|
|
|
827
749
|
}
|
|
828
750
|
}
|
|
829
751
|
|
|
830
|
-
// @dynamic
|
|
831
752
|
class NString {
|
|
832
753
|
static IndexOf(str, searchStr, startIndex, count) {
|
|
833
754
|
let index = str.substr(startIndex, count).indexOf(searchStr);
|
|
@@ -876,7 +797,7 @@ class NString {
|
|
|
876
797
|
for (i = 0, l = str.length; i < l; i++) {
|
|
877
798
|
ch = str.charCodeAt(i);
|
|
878
799
|
hash = ((hash << 5) - hash) + ch;
|
|
879
|
-
hash |= 0;
|
|
800
|
+
hash |= 0;
|
|
880
801
|
}
|
|
881
802
|
return hash;
|
|
882
803
|
}
|
|
@@ -931,17 +852,14 @@ class NString {
|
|
|
931
852
|
let lenA = strA.length;
|
|
932
853
|
let lenB = strB.length;
|
|
933
854
|
let len = Math.min(lenA, lenB);
|
|
934
|
-
// compare character by character
|
|
935
855
|
for (let i = 0; i < len; i++) {
|
|
936
856
|
if (strA[i].charCodeAt(0) !== strB[i].charCodeAt(0)) {
|
|
937
857
|
return strA[i].charCodeAt(0) - strB[i].charCodeAt(0);
|
|
938
858
|
}
|
|
939
859
|
}
|
|
940
|
-
// if all characters are same , but length is different return the difference of length
|
|
941
860
|
if (lenA !== lenB) {
|
|
942
861
|
return lenA - lenB;
|
|
943
862
|
}
|
|
944
|
-
// all chars are same , so strings are equal
|
|
945
863
|
return 0;
|
|
946
864
|
}
|
|
947
865
|
static PadRight(source, maxLength, fillString) {
|
|
@@ -957,8 +875,6 @@ class NString {
|
|
|
957
875
|
}
|
|
958
876
|
static Replace(str, orgSubStr, newSubStr) {
|
|
959
877
|
let resultStr = '';
|
|
960
|
-
// fixed defect 151810: replace "*" with "\*" before we update the string so * will be as char and not reg exp
|
|
961
|
-
// also for special chars $ ^ . ? + , [
|
|
962
878
|
orgSubStr = orgSubStr.replace(new RegExp("\\\\", 'g'), "\\\\");
|
|
963
879
|
orgSubStr = orgSubStr.replace(new RegExp("\\*", 'g'), "\\\*");
|
|
964
880
|
orgSubStr = orgSubStr.replace(new RegExp("\\$", 'g'), "\\\$");
|
|
@@ -982,7 +898,7 @@ NString.Empty = "";
|
|
|
982
898
|
|
|
983
899
|
class NumberFormatInfo {
|
|
984
900
|
static GetLocaleDecimalSeperator() {
|
|
985
|
-
return (1.1).toLocaleString()[1];
|
|
901
|
+
return (1.1).toLocaleString()[1];
|
|
986
902
|
}
|
|
987
903
|
}
|
|
988
904
|
NumberFormatInfo.NegativeSign = '-';
|
|
@@ -1028,8 +944,6 @@ class Stack {
|
|
|
1028
944
|
}
|
|
1029
945
|
}
|
|
1030
946
|
|
|
1031
|
-
// StackFrame uses StackTrace utility using stacktrace-js utility from npm
|
|
1032
|
-
// https://www.npmjs.com/package/stacktrace-js
|
|
1033
947
|
class StackFrame {
|
|
1034
948
|
constructor(skipFrames, fNeedFileInfo) {
|
|
1035
949
|
this.stackFrame = null;
|
|
@@ -1043,35 +957,20 @@ class StackFrame {
|
|
|
1043
957
|
}
|
|
1044
958
|
}
|
|
1045
959
|
|
|
1046
|
-
// This uses StackTrace utility using stacktrace-js utility from npm. Use this in package.json
|
|
1047
|
-
// https://www.npmjs.com/package/stacktrace-js
|
|
1048
960
|
class StackTrace {
|
|
1049
961
|
GetFrames() {
|
|
1050
|
-
// Using getSync() method, it returns references of callstack ethod from the javascript files bindled and not typeScript file from sources.
|
|
1051
|
-
// However, if aSync method would have used, it overcomes above problems but the call to log would have been async and we would not have
|
|
1052
|
-
// received synchronous logs which would be confusing.
|
|
1053
962
|
return getSync();
|
|
1054
963
|
}
|
|
1055
964
|
}
|
|
1056
965
|
|
|
1057
|
-
// StringBuilder class. Its Implementation currently uses string object. It could have been string[], but it has issues when inserting string.
|
|
1058
|
-
// It would not have served purpose while inserting a string. Other could be to use string[] with one chraracter per string. Even its utility
|
|
1059
|
-
// is doubtful as while manipulation, it would be creting new objects instead pointers. So for now we have used only string and see if we have
|
|
1060
|
-
// any performance issues.
|
|
1061
966
|
class StringBuilder {
|
|
1062
967
|
constructor(valueOrLength, length) {
|
|
1063
968
|
this.part = "";
|
|
1064
969
|
if (arguments.length > 0) {
|
|
1065
970
|
if (valueOrLength != null && valueOrLength.constructor === Number) {
|
|
1066
|
-
// TODO: Very low priority performance improvement - Implement this.
|
|
1067
|
-
// Debug.Assert(false, "StringBuilder: NotImplemented constructor with initial length/capacity");
|
|
1068
|
-
// throw new Error("NotImplemented constructor with initial length/capacity");
|
|
1069
971
|
}
|
|
1070
972
|
else if (valueOrLength != null && valueOrLength.constructor === String) {
|
|
1071
973
|
this.part = valueOrLength.toString();
|
|
1072
|
-
// TODO: Very low priority performance improvement - Implement this.
|
|
1073
|
-
// if (arguments.length === 2)
|
|
1074
|
-
// Debug.Assert(false, "NotImplemented constructor with initial length/capacity");
|
|
1075
974
|
}
|
|
1076
975
|
}
|
|
1077
976
|
}
|
|
@@ -1092,17 +991,14 @@ class StringBuilder {
|
|
|
1092
991
|
this.AppendNumber(textOrNum, startIndexOrNumberOfCharacters);
|
|
1093
992
|
return this;
|
|
1094
993
|
}
|
|
1095
|
-
// Append string
|
|
1096
994
|
AppendString(text, startIndex = 0, charCount = text.length) {
|
|
1097
995
|
this.part = this.part + text.substr(startIndex, charCount);
|
|
1098
996
|
}
|
|
1099
|
-
// Append Number
|
|
1100
997
|
AppendNumber(num, numberOfCharacters = 1) {
|
|
1101
998
|
if (numberOfCharacters <= 0)
|
|
1102
999
|
throw new Error("numberOfCharacters cannot be less than or equal to zero");
|
|
1103
1000
|
this.part = this.part + num.toString().repeat(numberOfCharacters);
|
|
1104
1001
|
}
|
|
1105
|
-
// Append Line
|
|
1106
1002
|
AppendLine(text = null) {
|
|
1107
1003
|
if (text !== null)
|
|
1108
1004
|
this.part = this.part + text;
|
|
@@ -1172,7 +1068,6 @@ class StringBuilder {
|
|
|
1172
1068
|
}
|
|
1173
1069
|
return this;
|
|
1174
1070
|
}
|
|
1175
|
-
// return the string
|
|
1176
1071
|
toString() {
|
|
1177
1072
|
return this.ToString();
|
|
1178
1073
|
}
|
|
@@ -1183,10 +1078,6 @@ class Thread {
|
|
|
1183
1078
|
this.ManagedThreadId = 0;
|
|
1184
1079
|
this.ManagedThreadId = Thread.nextId++;
|
|
1185
1080
|
}
|
|
1186
|
-
/// <summary>
|
|
1187
|
-
/// Free the thread so it will be able to do other work, like gui events
|
|
1188
|
-
/// </summary>
|
|
1189
|
-
/// <param name = "millisecondsTimeout"> timeout in milliseconds</param>
|
|
1190
1081
|
static Sleep(millisecondsTimeout) {
|
|
1191
1082
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1192
1083
|
yield new Promise((resolve, reject) => {
|
|
@@ -1209,15 +1100,10 @@ class WebException extends Exception {
|
|
|
1209
1100
|
}
|
|
1210
1101
|
|
|
1211
1102
|
class XmlConvert {
|
|
1212
|
-
// TODO : Implement
|
|
1213
1103
|
static EncodeName(name) {
|
|
1214
1104
|
throw new NotImplementedException();
|
|
1215
1105
|
}
|
|
1216
1106
|
}
|
|
1217
1107
|
|
|
1218
|
-
/**
|
|
1219
|
-
* Generated bundle index. Do not edit.
|
|
1220
|
-
*/
|
|
1221
|
-
|
|
1222
1108
|
export { $$, $0, $9, $A, $AMPERSAND, $AT, $BACKSLASH, $BANG, $BAR, $BT, $CARET, $COLON, $COMMA, $CR, $DQ, $E, $EOF, $EQ, $F, $FF, $GT, $HASH, $LBRACE, $LBRACKET, $LF, $LPAREN, $LT, $MINUS, $NBSP, $PERCENT, $PERIOD, $PIPE, $PLUS, $QUESTION, $RBRACE, $RBRACKET, $RPAREN, $SEMICOLON, $SLASH, $SPACE, $SQ, $STAR, $TAB, $TILDA, $VTAB, $X, $Z, $_, $a, $e, $f, $n, $r, $t, $u, $v, $x, $z, ApplicationException, Array_Enumerator, BitArray, Char, CultureInfo, DateTime, DateTimeKind, Debug, Dictionary, Encoding, Exception, HashUtils, Hashtable, ISO_8859_1_Encoding, Int32, Int64, List, NChar, NNumber, NString, NotImplementedException, NumberFormatInfo, NumberStyles, RefParam, Stack, StackFrame, StackTrace, StringBuilder, Thread, WebException, XmlConvert, isAsciiHexDigit, isAsciiLetter, isDigit, isLowerCase, isUpperCase, isWhitespace };
|
|
1223
1109
|
//# sourceMappingURL=magic-xpa-mscorelib.js.map
|