Skip to content

Commit

Permalink
codegen: add todo throws for destructuring
Browse files Browse the repository at this point in the history
test262: 11.28% (-0.01) | πŸ§ͺ 49377 | 🀠 5570 (-6) | ❌ 1247 (-30) | πŸ’€ 8683 (-115) | 🧩 2517 (-6) | πŸ’₯ 754 (-352) | ⏰ 2 | πŸ“ 30604 (+509)
  • Loading branch information
CanadaHonk committed Feb 12, 2024
1 parent 1ad50e9 commit 4c545e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/codeGen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,8 @@ const generateVar = (scope, decl) => {
for (const x of decl.declarations) {
const name = mapName(x.id.name);

if (!name) return todo('destructuring is not supported yet');

if (x.init && isFuncType(x.init.type)) {
// hack for let a = function () { ... }
x.init.id = { name };
Expand Down Expand Up @@ -2070,6 +2072,8 @@ const generateAssign = (scope, decl) => {
];
}

if (!name) return todo('destructuring is not supported yet');

const [ local, isGlobal ] = lookupName(scope, name);

if (local === undefined) {
Expand Down

0 comments on commit 4c545e7

Please sign in to comment.