You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 07e72ed
Browse filesBrowse the repository at this point in the historyBrowse files
throw new Error(`Unsupported Swift inline String length: ${count} UTF-8 bytes (maximum 8). The Swift String layout may have changed; update JavaScriptKit and regenerate BridgeJS glue.`);
337
+
}
339
338
let byteIndex = 0,
340
339
unitCount = 0,
341
340
u0 = 0,
@@ -345,23 +344,21 @@ public struct BridgeJSLink {
throw new Error(`Unsupported Swift inline String length: ${count} UTF-8 bytes (maximum 8). The Swift String layout may have changed; update JavaScriptKit and regenerate BridgeJS glue.`);
// Unexpected inline lengths must fail for both ASCII and Unicode discriminators.
63
+
for(constcountof[9,10]){
64
+
for(constdiscriminatorof[0xe0,0xa0]){
65
+
words=[0,0,(discriminator|count)<<8];
66
+
assert.throws(()=>exports.checkString(),{
67
+
name: 'Error',
68
+
message: `Unsupported Swift inline String length: ${count} UTF-8 bytes (maximum 8). The Swift String layout may have changed; update JavaScriptKit and regenerate BridgeJS glue.`,
// Valid small Swift strings need at most ten UTF-16 code units.
698
-
constdecodeSmallUTF8=(word0,word1,word2,count)=>{
692
+
: (word1>>>((byteIndex-4)*8))&255;
693
+
// Valid small Swift strings need at most eight UTF-16 code units.
694
+
constdecodeSmallUTF8=(word0,word1,count)=>{
695
+
if(count>8){
696
+
thrownewError(`Unsupported Swift inline String length: ${count} UTF-8 bytes (maximum 8). The Swift String layout may have changed; update JavaScriptKit and regenerate BridgeJS glue.`);
697
+
}
699
698
letbyteIndex=0,
700
699
unitCount=0,
701
700
u0=0,
@@ -705,23 +704,21 @@ export async function createInstantiator(options, swift) {
thrownewError(`Unsupported Swift inline String length: ${count} UTF-8 bytes (maximum 8). The Swift String layout may have changed; update JavaScriptKit and regenerate BridgeJS glue.`);
0 commit comments