CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 22:33:20 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/chakra-core/ChakraCore.git
etag: W/"74f62fa1166c008bbbcc7986d5987f6c"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=R8FQy6QfNU6PO9TYamBAFJUYOcdfXtSwtYQnMT%2FhPhOFK6IRodZvG1TQT%2F1RznQYKqKDItxcL9sDXghRAmdF6AZ7bj3NKXSdMFPvdoJEFc2PDm6SvNKAZGq1dM2U5Rvcu7JEhKkIiEF2UeekCLZE0iemc2eNVvYoN2mN8pne1ueewFNjfJvI8QDSeH5xB1FZvt4QrktOwU%2F2fbBleAAIdCJHKj7ajuUA0bpSGLYuOqUel4ni3FwE8%2BJITkVMDL1lnAqLCNv8Gp3ym9w60WcJWw%3D%3D--BeL60JW5GHE%2BiiIh--jGqB1Y9pFyMe0%2FB6gvzqAA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.375719457.1753309999; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 22:33:19 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 22:33:19 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: DECC:394F4C:113380C:1495196:6881632F
Dynamic Module Import · chakra-core/ChakraCore@2277186 · GitHub
committedDismiss banner
Copy file name to clipboardExpand all lines: bin/NativeTests/JsRTApiTest.cpp
Copy file name to clipboardExpand all lines: bin/ch/HostConfigFlagsList.h
Copy file name to clipboardExpand all lines: lib/Backend/JnHelperMethodList.h
Copy file name to clipboardExpand all lines: lib/Common/ConfigFlagsList.h
Copy file name to clipboardExpand all lines: lib/Common/Memory/ArenaAllocator.h
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit 2277186

Suwei Chen
Dynamic Module Import
This PR adds support for import() dynamic module import sematic.
Per https://github.com/tc39/proposal-dynamic-import:
"A call to import(specifier) returns a promise for the module namespace object of the requested module, which is created after fetching, instantiating, and evaluating all of the module's dependencies, as well as the module itself.
"Here specifier will be interpreted the same way as in an import declaration (i.e., the same strings will work in both places). However, while specifier is a string it is not necessarily a string literal; thus code like import(`./language-packs/${navigator.language}.js`) will work—something impossible to accomplish with the usual import declarations.
"import() is proposed to work in both scripts and modules. This gives script code an easy asynchronous entry point into the module world, allowing it to start running module code."
This PR includes following changes:
- Update parser and bytecode generator to support import() sematic in module and in script
- Add new bytecode 'ImportCall'
- Add runtime function for import() that:
○ Uses caller from stack to look up module record or source context that are associated with the module or script from which 'import()' is called
○ Requests host to load target module source file (gets module record in return)
○ Creates promise unless the module record has one
○ Resolves/rejects promise if appropriates
○ Returns promise
- Add new host callback ('FetchImportedModuleFromScript') for fetching imported module from script (accepts source context)
- Add 'promiseCapability' field to module record class
- Update SourceTextModuleRecord's methods to accept callback from host and to handle dynamically imported module and its promise capability
- Update exception checks and assertions to cover new usage scenario of importing and evaluating module code with active script
Add unit tests for dynamic import functionality1 parent 12912e6 commit 2277186Copy full SHA for 2277186
File tree
Expand file treeCollapse file tree
41 files changed
+1146
-110
lines changedFilter options
- bin
- NativeTests
- ch
- lib
- Backend
- Common
- Memory
- Jsrt
- Core
- Parser
- Runtime
- Base
- ByteCode
- Language
- Library
- test
- UnitTestFramework
- es6
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
41 files changed
+1146
-110
lines changedbin/NativeTests/JsRTApiTest.cpp
Copy file name to clipboardExpand all lines: bin/NativeTests/JsRTApiTest.cpp+3Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1739 | 1739 |
| |
1740 | 1740 |
| |
1741 | 1741 |
| |
| 1742 | + | |
1742 | 1743 |
| |
1743 | 1744 |
| |
1744 | 1745 |
| |
| |||
1834 | 1835 |
| |
1835 | 1836 |
| |
1836 | 1837 |
| |
| 1838 | + | |
1837 | 1839 |
| |
1838 | 1840 |
| |
1839 | 1841 |
| |
| |||
1913 | 1915 |
| |
1914 | 1916 |
| |
1915 | 1917 |
| |
| 1918 | + | |
1916 | 1919 |
| |
1917 | 1920 |
| |
1918 | 1921 |
| |
|
+21-17Lines changed: 21 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
| 142 | + | |
154 | 143 |
| |
155 |
| - | |
156 |
| - | |
157 |
| - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
158 | 160 |
| |
159 |
| - | |
160 |
| - | |
| 161 | + | |
| 162 | + | |
161 | 163 |
| |
| 164 | + | |
| 165 | + | |
162 | 166 |
| |
163 | 167 |
| |
164 | 168 |
| |
|
bin/ch/HostConfigFlagsList.h
Copy file name to clipboardExpand all lines: bin/ch/HostConfigFlagsList.h+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| 14 | + | |
14 | 15 |
| |
15 | 16 |
|
+59-14Lines changed: 59 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
304 | 304 |
| |
305 | 305 |
| |
306 | 306 |
| |
| 307 | + | |
307 | 308 |
| |
308 | 309 |
| |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
314 | 321 |
| |
| 322 | + | |
315 | 323 |
| |
316 | 324 |
| |
317 | 325 |
| |
| |||
351 | 359 |
| |
352 | 360 |
| |
353 | 361 |
| |
| 362 | + | |
354 | 363 |
| |
355 |
| - | |
356 |
| - | |
| 364 | + | |
| 365 | + | |
357 | 366 |
| |
358 | 367 |
| |
359 | 368 |
| |
| |||
875 | 884 |
| |
876 | 885 |
| |
877 | 886 |
| |
| 887 | + | |
| 888 | + | |
878 | 889 |
| |
879 | 890 |
| |
880 | 891 |
| |
881 | 892 |
| |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
882 | 905 |
| |
883 | 906 |
| |
884 | 907 |
| |
| |||
1217 | 1240 |
| |
1218 | 1241 |
| |
1219 | 1242 |
| |
1220 |
| - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1221 | 1249 |
| |
1222 | 1250 |
| |
1223 | 1251 |
| |
| |||
1228 | 1256 |
| |
1229 | 1257 |
| |
1230 | 1258 |
| |
1231 |
| - | |
1232 |
| - | |
1233 |
| - | |
1234 |
| - | |
1235 |
| - | |
1236 |
| - | |
| 1259 | + | |
| 1260 | + | |
1237 | 1261 |
| |
1238 | 1262 |
| |
1239 | 1263 |
| |
| |||
1267 | 1291 |
| |
1268 | 1292 |
| |
1269 | 1293 |
| |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
1270 | 1315 |
| |
1271 | 1316 |
| |
1272 | 1317 |
| |
|
+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| 56 | + | |
56 | 57 |
| |
| 58 | + | |
57 | 59 |
| |
58 | 60 |
| |
59 | 61 |
| |
| |||
116 | 118 |
| |
117 | 119 |
| |
118 | 120 |
| |
| 121 | + | |
| 122 | + | |
119 | 123 |
| |
120 | 124 |
| |
121 | 125 |
| |
|
lib/Backend/JnHelperMethodList.h
Copy file name to clipboardExpand all lines: lib/Backend/JnHelperMethodList.h+2Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
507 | 507 |
| |
508 | 508 |
| |
509 | 509 |
| |
| 510 | + | |
| 511 | + | |
510 | 512 |
| |
511 | 513 |
| |
512 | 514 |
| |
|
+14Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2844 | 2844 |
| |
2845 | 2845 |
| |
2846 | 2846 |
| |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
2847 | 2861 |
| |
2848 | 2862 |
| |
2849 | 2863 |
| |
|
lib/Common/ConfigFlagsList.h
Copy file name to clipboardExpand all lines: lib/Common/ConfigFlagsList.h+2-5Lines changed: 2 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
532 | 532 |
| |
533 | 533 |
| |
534 | 534 |
| |
535 |
| - | |
| 535 | + | |
536 | 536 |
| |
537 | 537 |
| |
538 | 538 |
| |
| |||
998 | 998 |
| |
999 | 999 |
| |
1000 | 1000 |
| |
1001 |
| - | |
1002 |
| - | |
1003 |
| - | |
1004 |
| - | |
| 1001 | + | |
1005 | 1002 |
| |
1006 | 1003 |
| |
1007 | 1004 |
| |
|
lib/Common/Memory/ArenaAllocator.h
Copy file name to clipboardExpand all lines: lib/Common/Memory/ArenaAllocator.h+6Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 |
| |
25 | 31 |
| |
26 | 32 |
| |
|
+17-1Lines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 |
| - | |
| 41 | + | |
| 42 | + | |
42 | 43 |
| |
43 | 44 |
| |
44 | 45 |
| |
| |||
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
73 | 89 |
| |
74 | 90 |
| |
75 | 91 |
| |
|
You can’t perform that action at this time.
0 commit comments