Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxc_transformer/src/decorator/legacy/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ impl<'a> LegacyDecoratorMetadata<'a, '_> {
right: Expression<'a>,
ctx: &TraverseCtx<'a>,
) -> Expression<'a> {
let operator = BinaryOperator::StrictEquality;
let operator = BinaryOperator::StrictInequality;
let undefined = ctx.ast.expression_string_literal(SPAN, "undefined", None);
let typeof_left = ctx.ast.expression_unary(SPAN, UnaryOperator::Typeof, left);
let left_check = ctx.ast.expression_binary(SPAN, typeof_left, operator, undefined);
Expand Down
26 changes: 24 additions & 2 deletions tasks/transform_conformance/snapshots/oxc.snap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
commit: 578ac4df

Passed: 137/221
Passed: 137/223

# All Passed:
* babel-plugin-transform-class-static-block
Expand Down Expand Up @@ -319,7 +319,29 @@ x Output mismatch
x Output mismatch


# legacy-decorators (2/64)
# legacy-decorators (2/66)
* oxc/metadata/bound-type-reference/input.ts
Symbol reference IDs mismatch for "BoundTypeReference":
after transform: SymbolId(0): [ReferenceId(1), ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6)]
rebuilt : SymbolId(0): [ReferenceId(1), ReferenceId(6), ReferenceId(7)]
Symbol span mismatch for "Example":
after transform: SymbolId(1): Span { start: 87, end: 94 }
rebuilt : SymbolId(2): Span { start: 0, end: 0 }
Symbol span mismatch for "Example":
after transform: SymbolId(4): Span { start: 0, end: 0 }
rebuilt : SymbolId(3): Span { start: 87, end: 94 }

* oxc/metadata/unbound-type-reference/input.ts
Symbol span mismatch for "Example":
after transform: SymbolId(0): Span { start: 6, end: 13 }
rebuilt : SymbolId(1): Span { start: 0, end: 0 }
Symbol span mismatch for "Example":
after transform: SymbolId(3): Span { start: 0, end: 0 }
rebuilt : SymbolId(2): Span { start: 6, end: 13 }
Unresolved reference IDs mismatch for "UnboundTypeReference":
after transform: [ReferenceId(1), ReferenceId(2), ReferenceId(3)]
rebuilt : [ReferenceId(4), ReferenceId(5)]

* typescript/accessor/decoratorOnClassAccessor1/input.ts
Scope children mismatch:
after transform: ScopeId(0): [ScopeId(1), ScopeId(2)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { BoundTypeReference } from "./output";

console.log(BoundTypeReference)

class Example {
constructor(@dce count: BoundTypeReference) {}
prop: BoundTypeReference.Value = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { BoundTypeReference } from "./output";

var _ref;

console.log(BoundTypeReference);

let Example = class Example {
constructor(count) { }
prop = 1;
};

Example = babelHelpers.decorate(
[
babelHelpers.decorateMetadata("design:paramtypes", [
typeof (_ref =
typeof BoundTypeReference !== "undefined" && BoundTypeReference) ===
"function"
? _ref
: Object,
]),
babelHelpers.decorateParam(0, dce),
],
Example,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Example {
constructor(@dce count: UnboundTypeReference) {}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var _ref;
let Example = class Example {
constructor(count) {}
};

Example = babelHelpers.decorate(
[
babelHelpers.decorateMetadata("design:paramtypes", [
typeof (_ref =
typeof UnboundTypeReference !== "undefined" && UnboundTypeReference) ===
"function"
? _ref
: Object,
]),
babelHelpers.decorateParam(0, dce),
],
Example,
);
Loading