Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support classExpressions in DTE #101

Merged
merged 13 commits into from
Oct 20, 2023

Conversation

h-joo
Copy link

@h-joo h-joo commented Oct 16, 2023

Except for the commit e9ca3d4 everything else is non-functional, all others are fixing tests and moving things around, formatting.

to see where it's actually being used.

Signed-off-by: Hana Joo <hanajoo@google.com>
This is a non-functional move.

Signed-off-by: Hana Joo <hanajoo@google.com>
as it's doing trivial bitwise OR operation, also some other
parts of the code is doing |= instead, so try to be consistent.

Signed-off-by: Hana Joo <hanajoo@google.com>
if there's any error reported.

Signed-off-by: Hana Joo <hanajoo@google.com>
to reduce unncessary type checks

Signed-off-by: Hana Joo <hanajoo@google.com>
Also, avoid unncessary work caused by calling invalid(),
rather call reportIsolatedDeclarationError instead as it was the only
thing intended.

Signed-off-by: Hana Joo <hanajoo@google.com>
Signed-off-by: Hana Joo <hanajoo@google.com>
Signed-off-by: Hana Joo <hanajoo@google.com>
These seems all reasonable, we might have missed
something before that was not updated.

Signed-off-by: Hana Joo <hanajoo@google.com>
@h-joo h-joo force-pushed the classExpressions branch 2 times, most recently from 95c6bdc to a990f05 Compare October 17, 2023 16:40
Signed-off-by: Hana Joo <hanajoo@google.com>
This commit is totally non-functional

Signed-off-by: Hana Joo <hanajoo@google.com>
src/compiler/transformers/declarations.ts Show resolved Hide resolved
Comment on lines +65 to +82
let C = (() => {
let _classDecorators = [dec];
let _classDescriptor;
let _classExtraInitializers = [];
let _classThis;
var C = class {
static { _classThis = this; }
static {
__esDecorate(null, _classDescriptor = { value: this }, _classDecorators, { kind: "class", name: this.name }, null, _classExtraInitializers);
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
C = _classThis = _classDescriptor.value;
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
__runInitializers(_classThis, _classExtraInitializers);
}
};
return C = _classThis;
})();
export default C;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why this changed ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, this seemed to be broken already in the target branch, but I don't have a good imagination to understand what would have caused this to change.

1. Reuse reusable chunk of code.
2. Proper handling of accessors, before it treated as if there were only
   a single accessor in the class.
3. Improve wording in the error message for heritage clauses

Signed-off-by: Hana Joo <hanajoo@google.com>
const type = localInferenceFromInitializer(member, member.type);
if (!type) {
const { method, flags } = handleMethodDeclaration(member, member.name, NarrowBehavior.None);
if (flags === LocalTypeInfoFlags.Invalid) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please test with & for the invalid flag. Currently there is only one flag (used to be more) but I would like to keep the idea of this being a flag enum at least for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

1. use bitwise AND instead of comparison
2. report errors on property name for object literals instead of the
   object literal

Signed-off-by: Hana Joo <hanajoo@google.com>
@dragomirtitian dragomirtitian merged commit e878ebd into bloomberg:isolated-declarations Oct 20, 2023
1 check passed
@h-joo h-joo deleted the classExpressions branch October 20, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants