mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
Here implementing the es2015 new target transform, see detail at https://babel.dev/docs/babel-plugin-transform-template-new-target. Here has three kinds need to be distinguished. - `NewTargetKind::Method`, it from `AstKind::ObjectMethod` or `AstKind::MethodDefinitionKind::Get/Set/Method`. It will be transformed to `void 0`. - `NewTargetKind::Constructor`, is from ` AstKind::MethodDefinitionKind::Constructor`. It will be transformed to `this.constructor`. - `NewTargetKind::Function`, is from ` AstKind::Function`, here the function is not the above function. It will be transformed to `this instanceof _target ? this.constructor : void 0`, here `_target` comes from the function name or is created by scope uid ident. |
||
|---|---|---|
| .. | ||
| checker | ||
| class | ||
| jsdoc | ||
| module_record | ||
| binder.rs | ||
| builder.rs | ||
| diagnostics.rs | ||
| lib.rs | ||
| node.rs | ||
| reference.rs | ||
| scope.rs | ||
| symbol.rs | ||