René's URL Explorer Experiment


Title: feat: Node-style primordials for runtime builtins by edusperoni · Pull Request #1990 · NativeScript/android · GitHub

Open Graph Title: feat: Node-style primordials for runtime builtins by edusperoni · Pull Request #1990 · NativeScript/android

X Title: feat: Node-style primordials for runtime builtins by edusperoni · Pull Request #1990 · NativeScript/android

Description: Description Android mirror of NativeScript/ios#415. Stacked on #1989 (feat/js-builtins) — review only the last commit. The runtime's builtin JavaScript installs globals and leaves closures behind that run for the lifetime of the app: event dispatch, the URL/blob glue, console's stringify, the JS→org.json serializer. Until now those closures reached for intrinsics (Array.prototype.slice, JSON.stringify, Object.defineProperty, …) through the live globals, so app code replacing one could break runtime internals or observe them. internal/primordials.js captures exactly the intrinsics the other builtins need into a frozen, null-prototype namespace, Node-style — trimmed to what the Android builtins actually reach (not a mirror of Node's or iOS's list). The (binding, primordials) contract Builtins now compile with four fixed parameters: exports, module, binding, primordials. The snapshot is built lazily on the first RunBuiltin of an isolate — during runtime init, before any user code — and cached per isolate (mutex-guarded, released on isolate disposal; worker isolates snapshot their own realm's intrinsics automatically). Instance methods are uncurried exactly as Node does it (ArrayPrototypeSlice(list, 1), via Function.prototype.bind.bind(Function.prototype.call)); statics keep their path (JSONStringify). Plain constructor calls made once at init time stay direct — the rule targets closures that outlive init. Deliberately left live: Blob/File in blob-url.js (app-layer provided), global.__requireOverride in require-factory.js (app-layer hook), org.json.* in json-helper.js (metadata interceptor, not an intrinsic). Enforcement: ESLint no-restricted-properties for every captured static and no-restricted-globals for every captured constructor, each message naming the replacement; primordials.js itself is exempted. Both rule classes verified to fire. Tests: new tests/testPrimordials.js (8 specs) tampers with the intrinsics and checks the runtime keeps working — a guard spec proving the tampering is observable, global dispatchEvent/add/remove/once under broken Array.prototype.* + Function.prototype.call, reportError delivering a correct ErrorEvent, circular console.log staying non-fatal, plus Android-specific specs for the searchParams re-sync, the blob store under broken Map.prototype.*, and org.json serialization under broken Array/Object/Date intrinsics. Each spec keeps the tampered window synchronous and assertion-free, restoring originals in finally. Related Pull Requests NativeScript/ios#415 (iOS counterpart) #1989 (base) Does your pull request have unit tests? Yes — 8 new device specs. Full suite: 613 specs, 0 failures (605 baseline + 8), including worker suites, which exercise per-isolate snapshot creation and disposal on worker threads. Summary by CodeRabbit New Features Added protected runtime handling for built-in JavaScript functionality, improving reliability when application code modifies standard globals. Runtime components now share stable intrinsic references throughout an isolate’s lifetime. Bug Fixes Improved event handling, timers, URL and blob operations, JSON serialization, error reporting, and weak-reference behavior under altered built-ins. Added cleanup to prevent stale runtime state after an execution context is disposed. Documentation Documented the runtime’s protected built-in behavior and usage guidelines. Tests Added comprehensive coverage for intrinsic replacement, event dispatch, logging, URL operations, serialization, and related runtime behavior.

Open Graph Description: Description Android mirror of NativeScript/ios#415. Stacked on #1989 (feat/js-builtins) — review only the last commit. The runtime's builtin JavaScript installs globals and leaves closures behi...

X Description: Description Android mirror of NativeScript/ios#415. Stacked on #1989 (feat/js-builtins) — review only the last commit. The runtime's builtin JavaScript installs globals and leaves closures ...

Opengraph URL: https://github.com/NativeScript/android/pull/1990

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6d4053ec-65aa-a3a4-b9ea-8f940bc4c104
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id99AE:34CAB:167E111:1CB7AF8:6B013C2F
html-safe-nonce204a0d69c1052969fc880130bcc5634717f4b2c22a32d62adaf983ed60e50fa9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUFFOjM0Q0FCOjE2N0UxMTE6MUNCN0FGODo2QjAxM0MyRiIsInZpc2l0b3JfaWQiOiI1MzUyNTIxMzI5OTI3MDc2OTExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9f3e52c53e0aae6ac8cb23e9fcf8f3f31c2281bef31235deeda4c99e02994ee8
hovercard-subject-tagpull_request:4172520874
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/1990/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altDescription Android mirror of NativeScript/ios#415. Stacked on #1989 (feat/js-builtins) — review only the last commit. The runtime's builtin JavaScript installs globals and leaves closures behi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/1990/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F1990%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F1990%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/1990/files
Reloadhttps://github.com/NativeScript/android/pull/1990/files
Reloadhttps://github.com/NativeScript/android/pull/1990/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests24 (24)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
NathanWalkerhttps://github.com/NathanWalker
mainhttps://github.com/NativeScript/android/tree/main
feat/primordialshttps://github.com/NativeScript/android/tree/feat/primordials
Conversation 5 https://github.com/NativeScript/android/pull/1990
Commits 3 https://github.com/NativeScript/android/pull/1990/commits
Checks 4 https://github.com/NativeScript/android/pull/1990/checks
Files changed https://github.com/NativeScript/android/pull/1990/files
Please reload this pagehttps://github.com/NativeScript/android/pull/1990/files
feat: Node-style primordials for runtime builtins https://github.com/NativeScript/android/pull/1990/files#top
Show all changes 3 commits https://github.com/NativeScript/android/pull/1990/files
05dc54b refactor: move embedded runtime JS to real .js files (js2c) edusperoni Jul 30, 2026 https://github.com/NativeScript/android/pull/1990/commits/05dc54b3980227fffd0675dee36fb4b05b3e48ca
4687302 feat: Node-style primordials for runtime builtins edusperoni Jul 30, 2026 https://github.com/NativeScript/android/pull/1990/commits/4687302f82114cbf1f426b7d8358c27868901757
d9ea139 Merge remote-tracking branch 'origin/main' into feat/primordials Copilot Aug 11, 2026 https://github.com/NativeScript/android/pull/1990/commits/d9ea139d01c7cd23efb0f48f206830795cb9f4d8
Clear filters https://github.com/NativeScript/android/pull/1990/files
Please reload this pagehttps://github.com/NativeScript/android/pull/1990/files
Please reload this pagehttps://github.com/NativeScript/android/pull/1990/files
eslint.config.mjs https://github.com/NativeScript/android/pull/1990/files#diff-9601a8f6c734c2001be34a2361f76946d19a39a709b5e8c624a2a5a0aade05f2
mainpage.js https://github.com/NativeScript/android/pull/1990/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
testPrimordials.js https://github.com/NativeScript/android/pull/1990/files#diff-65d2df1eed774cb0fc31718982c26c45fa2e35f77e26663a033dee907b0142bb
CMakeLists.txt https://github.com/NativeScript/android/pull/1990/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
BuiltinLoader.cpp https://github.com/NativeScript/android/pull/1990/files#diff-fcedb819fe4f3f0f0406fa6f3ad2e6b725f6f39d83737af64486c91ba96fdffa
BuiltinLoader.h https://github.com/NativeScript/android/pull/1990/files#diff-80ceda457b8ed4e5fc6f0d5a7cb59538fb88ffd8b9787e6f91c8f6be728c05d8
IsolateDisposer.cpp https://github.com/NativeScript/android/pull/1990/files#diff-665bfa196480c5d77dc1764a434d06ae4c4c5e1b107dc9efce1452692ceb6894
README.md https://github.com/NativeScript/android/pull/1990/files#diff-751334ceaf7705bb581ba52ea1f45b471007312e7194253725e94c12eb8f22fe
blob-url.js https://github.com/NativeScript/android/pull/1990/files#diff-19211cd754e180023a158d6a88fb191350cf0260fd3332c0c4fecabe37c58b89
error-events.js https://github.com/NativeScript/android/pull/1990/files#diff-819b39a5be6266ede2c585e82de3aeac11dd3050630c475aa0bf4d7df76eb230
events.js https://github.com/NativeScript/android/pull/1990/files#diff-15bc07870a0153b6b63d42bcfe4c35c81696d01b681d4c816f2206f5cea57f38
json-helper.js https://github.com/NativeScript/android/pull/1990/files#diff-23550ca710e1e04893a967cea40d39f573659c79194422a642896f547bab6f0a
message-loop-timer.js https://github.com/NativeScript/android/pull/1990/files#diff-ff2a387c5b9773e115f0f4549e0b60f5f283ebc07cde8e240b83eb0e2d35031b
primordials.js https://github.com/NativeScript/android/pull/1990/files#diff-9b1f22214698543a37f4ef99bb7a3c87aa30de65ecd042dd7b9eec18501914fc
smart-stringify.js https://github.com/NativeScript/android/pull/1990/files#diff-d564b0004a6655710ecdda742d533a621ebd2e7a97d75c8a2ffd71db5dd45592
weak-ref.js https://github.com/NativeScript/android/pull/1990/files#diff-5535cf513e247d8b95cef01470e7429e7b1ec975623f6daa2dd300e7aa90ea9e
eslint.config.mjshttps://github.com/NativeScript/android/pull/1990/files#diff-9601a8f6c734c2001be34a2361f76946d19a39a709b5e8c624a2a5a0aade05f2
View file https://github.com/NativeScript/android/blob/d9ea139d01c7cd23efb0f48f206830795cb9f4d8/eslint.config.mjs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/1990/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/1990/files#diff-9601a8f6c734c2001be34a2361f76946d19a39a709b5e8c624a2a5a0aade05f2
https://github.com/NativeScript/android/pull/1990/files#diff-9601a8f6c734c2001be34a2361f76946d19a39a709b5e8c624a2a5a0aade05f2
test-app/app/src/main/assets/app/mainpage.jshttps://github.com/NativeScript/android/pull/1990/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
View file https://github.com/NativeScript/android/blob/d9ea139d01c7cd23efb0f48f206830795cb9f4d8/test-app/app/src/main/assets/app/mainpage.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/1990/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/1990/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
test-app/app/src/main/assets/app/tests/testPrimordials.jshttps://github.com/NativeScript/android/pull/1990/files#diff-65d2df1eed774cb0fc31718982c26c45fa2e35f77e26663a033dee907b0142bb
View file https://github.com/NativeScript/android/blob/d9ea139d01c7cd23efb0f48f206830795cb9f4d8/test-app/app/src/main/assets/app/tests/testPrimordials.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/1990/{{ revealButtonHref }}
coderabbitaihttps://github.com/apps/coderabbitai
Aug 11, 2026https://github.com/NativeScript/android/pull/1990/files#r3755018716
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/NativeScript/android/pull/1990/files
test-app/runtime/CMakeLists.txthttps://github.com/NativeScript/android/pull/1990/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
View file https://github.com/NativeScript/android/blob/d9ea139d01c7cd23efb0f48f206830795cb9f4d8/test-app/runtime/CMakeLists.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/1990/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/1990/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
https://github.com/NativeScript/android/pull/1990/files#diff-9aa48152a82c07a60ab6e09923a9b266e2985f78e579653848df730cd8ec5e4c
Please reload this pagehttps://github.com/NativeScript/android/pull/1990/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.