vite 8.2.1 → 8.2.2

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.
@@ -1650,13 +1650,15 @@ var Tokenizer = class {
1650
1650
  this.active = false;
1651
1651
  }
1652
1652
  _appendCharToCurrentCharacterToken(type, ch) {
1653
- if (this.currentCharacterToken) if (this.currentCharacterToken.type === type) {
1654
- this.currentCharacterToken.chars += ch;
1655
- return;
1656
- } else {
1657
- this.currentLocation = this.getCurrentLocation(0);
1658
- this._emitCurrentCharacterToken(this.currentLocation);
1659
- this.preprocessor.dropParsedChunk();
1653
+ if (this.currentCharacterToken) {
1654
+ if (this.currentCharacterToken.type === type) {
1655
+ this.currentCharacterToken.chars += ch;
1656
+ return;
1657
+ } else {
1658
+ this.currentLocation = this.getCurrentLocation(0);
1659
+ this._emitCurrentCharacterToken(this.currentLocation);
1660
+ this.preprocessor.dropParsedChunk();
1661
+ }
1660
1662
  }
1661
1663
  this._createCharacterToken(type, ch);
1662
1664
  }
@@ -2632,14 +2634,15 @@ var Tokenizer = class {
2632
2634
  } else if (this._consumeSequenceIfMatch(SEQUENCES.DOCTYPE, false)) {
2633
2635
  this.currentLocation = this.getCurrentLocation(SEQUENCES.DOCTYPE.length + 1);
2634
2636
  this.state = State.DOCTYPE;
2635
- } else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) if (this.inForeignNode) this.state = State.CDATA_SECTION;
2636
- else {
2637
- this._err(ERR.cdataInHtmlContent);
2638
- this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
2639
- this.currentToken.data = "[CDATA[";
2640
- this.state = State.BOGUS_COMMENT;
2641
- }
2642
- else if (!this._ensureHibernation()) {
2637
+ } else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) {
2638
+ if (this.inForeignNode) this.state = State.CDATA_SECTION;
2639
+ else {
2640
+ this._err(ERR.cdataInHtmlContent);
2641
+ this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
2642
+ this.currentToken.data = "[CDATA[";
2643
+ this.state = State.BOGUS_COMMENT;
2644
+ }
2645
+ } else if (!this._ensureHibernation()) {
2643
2646
  this._err(ERR.incorrectlyOpenedComment);
2644
2647
  this._createCommentToken(2);
2645
2648
  this.state = State.BOGUS_COMMENT;
@@ -3308,13 +3311,15 @@ var Tokenizer = class {
3308
3311
  }
3309
3312
  _stateCharacterReference() {
3310
3313
  let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
3311
- if (length < 0) if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
3312
- else {
3313
- this.active = false;
3314
- this.preprocessor.pos = this.preprocessor.html.length - 1;
3315
- this.consumedAfterSnapshot = 0;
3316
- this.preprocessor.endOfChunkHit = true;
3317
- return;
3314
+ if (length < 0) {
3315
+ if (this.preprocessor.lastChunkWritten) length = this.entityDecoder.end();
3316
+ else {
3317
+ this.active = false;
3318
+ this.preprocessor.pos = this.preprocessor.html.length - 1;
3319
+ this.consumedAfterSnapshot = 0;
3320
+ this.preprocessor.endOfChunkHit = true;
3321
+ return;
3322
+ }
3318
3323
  }
3319
3324
  if (length === 0) {
3320
3325
  this.preprocessor.pos = this.entityStartPos;
@@ -3510,13 +3515,15 @@ var OpenElementStack = class {
3510
3515
  }
3511
3516
  remove(element) {
3512
3517
  const idx = this._indexOf(element);
3513
- if (idx >= 0) if (idx === this.stackTop) this.pop();
3514
- else {
3515
- this.items.splice(idx, 1);
3516
- this.tagIDs.splice(idx, 1);
3517
- this.stackTop--;
3518
- this._updateCurrentElement();
3519
- this.handler.onItemPop(element, false);
3518
+ if (idx >= 0) {
3519
+ if (idx === this.stackTop) this.pop();
3520
+ else {
3521
+ this.items.splice(idx, 1);
3522
+ this.tagIDs.splice(idx, 1);
3523
+ this.stackTop--;
3524
+ this._updateCurrentElement();
3525
+ this.handler.onItemPop(element, false);
3526
+ }
3520
3527
  }
3521
3528
  }
3522
3529
  tryPeekProperlyNestedBodyElement() {