mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +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. |
||
|---|---|---|
| .. | ||
| oxc | ||
| oxc_allocator | ||
| oxc_ast | ||
| oxc_cli | ||
| oxc_codegen | ||
| oxc_diagnostics | ||
| oxc_index | ||
| oxc_js_regex | ||
| oxc_language_server | ||
| oxc_linter | ||
| oxc_linter_plugin | ||
| oxc_macros | ||
| oxc_minifier | ||
| oxc_parser | ||
| oxc_prettier | ||
| oxc_query | ||
| oxc_semantic | ||
| oxc_span | ||
| oxc_syntax | ||
| oxc_transformer | ||
| oxc_type_synthesis | ||
| oxc_wasm | ||