Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions apps/oxlint/src-js/generated/deserialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let uint8,
sourceText,
sourceIsAscii,
sourceStartPos,
firstNonAsciiPos,
parent = null,
getLoc;

Expand Down Expand Up @@ -42,6 +43,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = sourceStartPos, e = sourceStartPos + sourceByteLen; i < e; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i - sourceStartPos;
break;
}
}
getLoc = getLocInput;
return deserialize(uint32[536870900]);
}
Expand Down Expand Up @@ -5857,11 +5866,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos >= sourceStartPos) return sourceText.substr(pos - sourceStartPos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos >= sourceStartPos && (sourceIsAscii || pos - sourceStartPos + len <= firstNonAsciiPos))
return sourceText.substr(pos - sourceStartPos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
19 changes: 14 additions & 5 deletions napi/parser/src-js/generated/deserialize/js.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.

let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos;
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos, firstNonAsciiPos;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
decodeStr = textDecoder.decode.bind(textDecoder),
Expand All @@ -20,6 +20,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -4513,11 +4521,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
18 changes: 14 additions & 4 deletions napi/parser/src-js/generated/deserialize/js_parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let uint8,
sourceText,
sourceIsAscii,
sourceEndPos,
firstNonAsciiPos,
parent = null;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
Expand All @@ -26,6 +27,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -5049,11 +5058,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
19 changes: 14 additions & 5 deletions napi/parser/src-js/generated/deserialize/js_range.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.

let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos;
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos, firstNonAsciiPos;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
decodeStr = textDecoder.decode.bind(textDecoder),
Expand All @@ -20,6 +20,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -5063,11 +5071,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
18 changes: 14 additions & 4 deletions napi/parser/src-js/generated/deserialize/js_range_parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let uint8,
sourceText,
sourceIsAscii,
sourceEndPos,
firstNonAsciiPos,
parent = null;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
Expand All @@ -26,6 +27,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -5602,11 +5611,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
19 changes: 14 additions & 5 deletions napi/parser/src-js/generated/deserialize/ts.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.

let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos;
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos, firstNonAsciiPos;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
decodeStr = textDecoder.decode.bind(textDecoder),
Expand All @@ -20,6 +20,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -4822,11 +4830,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
18 changes: 14 additions & 4 deletions napi/parser/src-js/generated/deserialize/ts_parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let uint8,
sourceText,
sourceIsAscii,
sourceEndPos,
firstNonAsciiPos,
parent = null;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
Expand All @@ -26,6 +27,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -5385,11 +5394,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
19 changes: 14 additions & 5 deletions napi/parser/src-js/generated/deserialize/ts_range.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.

let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos;
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceEndPos, firstNonAsciiPos;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
decodeStr = textDecoder.decode.bind(textDecoder),
Expand All @@ -20,6 +20,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -5403,11 +5411,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
18 changes: 14 additions & 4 deletions napi/parser/src-js/generated/deserialize/ts_range_parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let uint8,
sourceText,
sourceIsAscii,
sourceEndPos,
firstNonAsciiPos,
parent = null;

const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
Expand All @@ -26,6 +27,14 @@ function deserializeWith(buffer, sourceTextInput, sourceByteLen, getLocInput, de
float64 = buffer.float64;
sourceText = sourceTextInput;
sourceIsAscii = sourceText.length === sourceByteLen;
if (!sourceIsAscii) {
firstNonAsciiPos = sourceByteLen;
for (let i = 0; i < sourceByteLen; i++)
if (uint8[i] >= 128) {
firstNonAsciiPos = i;
break;
}
}
return deserialize(uint32[536870900]);
}

Expand Down Expand Up @@ -5966,11 +5975,12 @@ function deserializeStr(pos) {
len = uint32[pos32 + 2];
if (len === 0) return "";
pos = uint32[pos32];
if (sourceIsAscii && pos < sourceEndPos) return sourceText.substr(pos, len);
// Longer strings use `TextDecoder`
// TODO: Find best switch-over point
if (pos < sourceEndPos && (sourceIsAscii || pos + len <= firstNonAsciiPos))
return sourceText.substr(pos, len);
// Use `TextDecoder` for strings longer than 9 bytes.
// For shorter strings, the byte-by-byte loop below avoids native call overhead.
let end = pos + len;
if (len > 50) return decodeStr(uint8.subarray(pos, end));
if (len > 9) return decodeStr(uint8.subarray(pos, end));
// Shorter strings decode by hand to avoid native call
let out = "",
c;
Expand Down
Loading
Loading