-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules support #430
Open
mstoykov
wants to merge
148
commits into
dop251:master
Choose a base branch
from
mstoykov:modules
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Modules support #430
Changes from all commits
Commits
Show all changes
148 commits
Select commit
Hold shift + click to select a range
79f1235
Add import/export syntax support to the parser
oleiade c0a2c6f
fix panics
mstoykov c086747
fixup! Add import/export syntax support to the parser
oleiade 6c4b34a
WIP ModuleRecords implementation
mstoykov f58707a
WIP enabling of tests and fixing panics
mstoykov 0d2f247
WIP more "fixes"
mstoykov 56ef325
WIP treat import and export as identifiers in Object Property Key par…
oleiade 6568120
WIP address reserved-words/ident-name-keyword-memberexpr.js test
oleiade 96d718b
finish implementing ParseModule
mstoykov d181d64
Revert some changes to compileModule
mstoykov ba73998
Merge remote-tracking branch 'origin/master' into modules
mstoykov ea0512e
Require import/export to be in the global scope
mstoykov 8fc9a3b
Fix some export as syntax
mstoykov d0e7456
tc39: run module tests only as strict
mstoykov 6a26d4e
Fix a bunch of parsing and compilation errors
mstoykov 6a96898
Fix hostResolveImportedModule in tc39
mstoykov 4430b25
Fix some early errors
mstoykov af5be25
wip
mstoykov 85f5577
Add simple failing test
mstoykov c1786b3
Basic import/export for let/const/functions works + cleanup
mstoykov f26423c
Merge remote-tracking branch 'origin/master' into modules
mstoykov 9bafbfb
Implement basic default export/import
mstoykov 28d747c
Disable a bunch of class tests
mstoykov 27ae1e1
Default loop test
mstoykov c9d3713
WIP refactor
mstoykov 1e617f0
Make possible to Run the same compiled modules in parallel
mstoykov 238dccd
Split ParseModule into ParseModule And ModuleFromAst
mstoykov 26a0311
Fix go vet
mstoykov 2bfb575
Fix some test panics
mstoykov 439b7ec
More vet fixes
mstoykov 258d0cf
fixes for staticcheck
mstoykov 6acaadb
Make compiler when needed for modules
mstoykov b314f9b
Remove hostResolveImportedModule from runtime
mstoykov b1eeef4
fix returning ModuleInstance on Evaluation
mstoykov c1f7626
Fixes for imports in various cases
mstoykov 788e4c0
Use ModuleRecord not Instance when resolving during evaluation
mstoykov 0f987b8
Use ModuleRecord when resolving in compileImportDeclaration
mstoykov eaf169d
I think I got this wrong from the spec
mstoykov 4e6b825
Support arrow functions (among others) as default export
mstoykov a73983a
More parsing fies
mstoykov 82cf429
Throw ReferenceError before imports are initialized
mstoykov 04e0b13
Fix trailing commas in import lists
mstoykov 90a123b
Top level function definitions in modules should be lexical
mstoykov ecbdc4c
Throw syntax errors on exporting unknown bindings
mstoykov b50623e
Don't require a semicolon after default export of a function
mstoykov a8d14d0
Report ambigiuous impotts later
mstoykov f3e29a8
Fix a bunch of ambigious import/export tests
mstoykov 55b2c88
Fix lexical and indirect exports
mstoykov 95d8b1f
Fix parsing errors with semicolons
mstoykov 9c2eeb0
check identifiers on import
mstoykov 9438c84
relay error up when it happens during compilation of module
mstoykov a0905d8
Report default not being exported during runtime
mstoykov 764969c
Hacks around default exporting function and it being imported
mstoykov 9eee9ed
disable tests with generators
mstoykov 69f3638
Report duplicate import names as syntax error
mstoykov b4df043
Don't print each Link error
mstoykov 50f5a3c
WIP namespace support
mstoykov 67ce717
Disable one more test as it includes generators
mstoykov e2a6d0f
fix all namespace tests currently enabled
mstoykov 298427a
Enable more tests and fix this in module code
mstoykov 0d601bf
Fix namespace and default export combo
mstoykov 2a17760
Fix Object.keys for namespace
mstoykov ffbc556
Fix namespace @toStrinTag
mstoykov cc0f1fa
Dump exception stack on error in tc39 test
mstoykov 19c9705
Fix getOwnPropertyDesc on namespaces
mstoykov 5df2955
Disable test using generators
mstoykov ca6a056
Sort Namespace keys to fix 2 tests
mstoykov a8cca03
Fix a bunch of namespace tc39 tests
mstoykov ae9681c
Fix Object.hasOwnProperty - fixing two namespace tc39 tests
mstoykov 82e5070
Fix final failing tc39 test and 'fix' Object.freeze
mstoykov 0e64871
Fix parser tests
mstoykov cb59891
staticcheck fix
mstoykov c60a76b
Cleaning up module.go
mstoykov 85504f8
Rename module.go to modules.go
mstoykov 3d5ae31
making token/token_const.go diff smaller
mstoykov 7d1c44b
drops some logs from tc39_test.go
mstoykov 7284797
Remove strange code
mstoykov 66b293c
Revet some changes on compiler_expr.go
mstoykov 3df258e
some compiler.go cleanup and TODOs
mstoykov d267aab
Remove go-spew from the requirements
mstoykov 54cf237
Fix staticcheck
mstoykov 54c482f
Revert some vm.go changes
mstoykov c8cb78c
refactor ModuleRecord#GetExportedNames
mstoykov eea69e4
Rework *Module* interfaces and add a bigger not source code module test
mstoykov dce811c
Bump minimal go to 1.16 for io/fs
mstoykov dc51713
Merge remote-tracking branch 'origin/master' into modules
mstoykov f5a9c53
Merge remote-tracking branch 'origin/master' into modules
mstoykov ecf79f8
Enable tc39 module tests again and add class support
mstoykov 31502c6
Make GetBindingValue simpler
mstoykov bdf1719
don't panic in GetBindingValue when asked for not existing binding
mstoykov 82f046e
Don't require CyclicModuleRecord in a few places
mstoykov ec18d21
typo
mstoykov 7af4a69
Merge remote-tracking branch 'origin/master' into modules
mstoykov 22f4a9a
Drop some comments in the parser
mstoykov abdba61
Fix emptying the stack in the modules inner methods
mstoykov 0ebc65d
Fix import/export indexes
mstoykov 262260d
Some parser comment cleanup
mstoykov a3b018b
Move modules' namespace in separate file
mstoykov 9c46869
Some modules refactoring
mstoykov 17c7411
Add import.meta support
mstoykov 1917e74
fix parser tests
mstoykov 9fc296e
Merge remote-tracking branch 'origin/master' into modules
mstoykov 822c8e2
Fix usage of exports before the module is evaluated
mstoykov 8164826
dynamic import :tada:
mstoykov fa51094
Merge remote-tracking branch 'origin/master' into modules
mstoykov 48efda2
fix parser test
mstoykov 135e850
refactor
mstoykov aab267b
Make dynamic import usable with not source modules
mstoykov ca4fe85
Don't require the usage of unistring.String from ESM users
mstoykov e96fa25
Fix race in the simpleComboResolver
mstoykov 99a802c
Move SourceText module in separate file
mstoykov 4c85e02
Add support tla/async evaluation of modules
mstoykov 5f81441
fixup! Add support tla/async evaluation of modules
mstoykov cbddd50
Merge branch 'master' into modules
mstoykov a1a2dc5
Revert formatting
mstoykov ae2a9b9
drop wrong createImmutableBinding
mstoykov df602e6
Merge remote-tracking branch 'origin/master' into modules
mstoykov cbaa207
Merge commit 'd4bf6fde1b86bc185110897884ac99981f08a3c6' into modules
mstoykov 164d305
Merge commit '33bff8fdda616056a9eb9b42853e12e9feafc8f9' into modules
mstoykov 5c05a99
fixup! Merge commit '33bff8fdda616056a9eb9b42853e12e9feafc8f9' into m…
mstoykov f5eb8e6
fixup! Merge commit 'd4bf6fde1b86bc185110897884ac99981f08a3c6' into m…
mstoykov c42e14e
Merge commit 'bce246427290cf863f71bb8e13feecddfcf7a581' into modules
mstoykov 02a8ab7
Merge commit 'cc4634e76e9a7d2a06f4cb2a2d1ece06946f2f0a' into modules
mstoykov 00a05a6
Merge commit '2e4cbb9852728d28b9ca30b11c057de50686fe76' into modules
mstoykov c6432ea
Merge commit '78b980256d04d7fc5278cd9839c61ea10884c899' into modules
mstoykov 10e7629
Merge commit '5460598cfa3203e1b803d204ff54f8d7d7323a38' into modules
mstoykov 09c2894
Merge commit '746f7ebdc5149b6af9ac8ba2a0b1fc0ec917cdcc' into modules
mstoykov fe1020b
Merge commit '5937a312edda9e86e50a49da61ad09fde83063c3' into modules
mstoykov 80527f5
Merge commit 'e2f543bf4b4c03d1f86e5acde716acdfab08304b' into modules
mstoykov 80ec257
Merge remote-tracking branch 'origin/master' into modules
mstoykov 1fbb864
Merge remote-tracking branch 'origin/master' into modules
mstoykov 7986602
Use AsyncFunc to implement modules getting rid of old hack
mstoykov e2e7f14
Merge remote-tracking branch 'origin/master' into modules
mstoykov ec99aff
Remove dead code
mstoykov 530c106
TLA Support
mstoykov 2507228
Fix go vet
mstoykov 789cda2
Fix staticcheck and some cleanup
mstoykov a059c52
Fix old parser test :facepalm:
mstoykov bf5368f
more staticcheck fixes
mstoykov 97ea475
Merge remote-tracking branch 'origin/master' into modules
mstoykov a0920e6
Refactor modules_test.go to be more easy to work with
mstoykov 1b8ab0d
Support 'eval' with imported identifiers
mstoykov 2ecad8a
Fix errors and exceptions around modules and imports
mstoykov 5bcf414
small fix
mstoykov 7aaf816
Make certains SourceModules InitalizeEnvironement
mstoykov 178b2c3
Reduce diff size
mstoykov 08f562e
small fixes
mstoykov c733ab4
Merge remote-tracking branch 'origin/master' into modules
mstoykov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just what the specification says - I think the previous code was making it faster in some cases but I couldn't figure out how to fix it in any other way 🤷♂and had other problems ;)
This is problematic for the way I have implemented modules namespace, which might be the actual problem 🤷♂ but this was in reality one of the places where it had problems and both were fixed by doing exactly what the specification says.