Skip to content

Commit

Permalink
WIP 3
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 26, 2023
1 parent 7b42b5c commit e9f2cd9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions lib/instrument/visitors/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ function visitClass(classNode, parent, key, className, state) {
// `super` block is child of name block as `extends` clause and method/property
// computed keys can access class name, but not `super`.
// NB: Binding for `super` target is created lazily when a use of `super` is encountered.
// TODO: Is moving `super` binding into inside class correct?
const superBlock = createBlock(className, false, state);

// Get block ID for inner name block in case it's needed
Expand All @@ -109,8 +108,7 @@ function visitClass(classNode, parent, key, className, state) {
state.isStrict = true;

// Visit `extends` clause
const hasSuperClass = !!classNode.superClass;
if (hasSuperClass) {
if (classNode.superClass) {
fn.hasSuperClass = true;
visitKey(classNode, 'superClass', Expression, state);
}
Expand Down
1 change: 0 additions & 1 deletion lib/serialize/parseFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ module.exports = function parseFunction(
paramNodes = constructorNode ? constructorNode.params : [];

// Replace `extends` clause with `extends class {}`
// TODO: Make sure prototypes get changed in all cases.
if (isClassWithSuperClass) node.superClass = t.classExpression(null, null, t.classBody([]));
}
}
Expand Down

0 comments on commit e9f2cd9

Please sign in to comment.