@@ -147,6 +147,7 @@ test('runtime installs required escape-vector hooks', () => {
147147 const worker = fs . readFileSync ( 'web/worker-prelude.js' , 'utf8' ) ;
148148 for ( const needle of [
149149 "document.addEventListener('click'" ,
150+ "root.addEventListener('click'" ,
150151 "document.addEventListener('submit'" ,
151152 'HTMLFormElement.prototype' ,
152153 'popstate' ,
@@ -227,10 +228,10 @@ test('runtime installs required escape-vector hooks', () => {
227228 "name === 'origin'" ,
228229 "base === document && prop === 'location'" ,
229230 'frameOriginForSource(ev.source)' ,
230- "!Native.getAttribute.call(frame, 'data-zp-target-url')" ,
231- 'compatRelativeRequestBase(raw )' ,
232- "path === '/api/auth'" ,
233- 'https://shopsquare.naver.com/ ' ,
231+ 'shouldContainFrameWindow: isInitialAboutBlankFrame' ,
232+ 'shouldContainFrameWindow && shouldContainFrameWindow(this, childWin )' ,
233+ 'installRequestFacade' ,
234+ 'return new Native.Request(requestLike ? input : requestTargetURL(input), init) ' ,
234235 "Native.setAttribute.call(this, k, '')" ,
235236 "'WebSocketStream'" ,
236237 'getUserMedia' ,
@@ -294,6 +295,42 @@ test('runtime keeps JavaScript rewriting fail-closed and canonicalizes module UR
294295 ) ;
295296} ) ;
296297
298+ test ( 'filtered DOM collections expose numeric indexes to native slice' , ( ) => {
299+ const rt = readRuntimeSource ( ) ;
300+ assert . ok (
301+ rt . includes ( "has(_target, prop) { return prop === 'length' || (/^(?:0|[1-9]\\d*)$/.test(String(prop)) && Number(prop) < length()); }" ) ,
302+ 'filtered collection HasProperty must recognize all numeric indexes' ,
303+ ) ;
304+ assert . equal (
305+ rt . includes ( "has(_target, prop) { return prop === 'length' || (/^(?:0|[1-9]\\\\d*)$/.test(String(prop)) && Number(prop) < length()); }" ) ,
306+ false ,
307+ 'filtered collection HasProperty must not match a literal backslash-d' ,
308+ ) ;
309+ } ) ;
310+
311+ test ( 'classic script rewrite carries document charset for legacy Korean news scripts' , ( ) => {
312+ const rt = readRuntimeSource ( ) ;
313+ const sw = readServiceWorkerSource ( ) ;
314+ assert . ok ( rt . includes ( "const documentCharset = String(boot.documentCharset || '')" ) ) ;
315+ assert . ok ( rt . includes ( "params.set('dc', documentCharset)" ) ) ;
316+ assert . ok ( sw . includes ( "const documentCharset = url.searchParams.get('dc') || ''" ) ) ;
317+ assert . ok ( sw . includes ( 'scriptResponseText(resp, opt.documentCharset ||' ) ) ;
318+ assert . ok ( sw . includes ( 'new TextDecoder(charset).decode(bytes)' ) ) ;
319+ } ) ;
320+
321+ test ( 'runtime HTTP facade resolves relative requests without site-specific host maps' , ( ) => {
322+ const http = fs . readFileSync ( 'web/runtime/network/http.mjs' , 'utf8' ) ;
323+ assert . equal ( / n a v e r | p s t a t i c | s h o p s q u a r e | r e c o s h o p p i n g / i. test ( http ) , false ) ;
324+ assert . ok ( http . includes ( 'const parsed = new URL(raw, getBaseURL())' ) ) ;
325+ } ) ;
326+
327+ test ( 'Rust rewriter bootstrap falls back to async WASM load if sync bytes fail' , ( ) => {
328+ const build = fs . readFileSync ( 'scripts/build.mjs' , 'utf8' ) ;
329+ assert . ok ( build . includes ( 'function bootstrapInit()' ) ) ;
330+ assert . ok ( build . includes ( 'try { if (initSync()) return; } catch {} init().catch(() => {})' ) ) ;
331+ assert . ok ( build . includes ( 'bootstrapInit();' ) ) ;
332+ } ) ;
333+
297334test ( 'HTML document transform is a thin Go wrapper over Rust lol_html policy' , ( ) => {
298335 const htmltx = fs . readFileSync ( 'internal/htmltx/transform.go' , 'utf8' ) ;
299336 const kernel = fs . readFileSync ( 'cmd/wasm-kernel/main.go' , 'utf8' ) ;
0 commit comments