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

feat(binding): improve AST $kind classifying and other small tweaks/fixes #213

Merged
merged 11 commits into from
Oct 9, 2018

Conversation

fkleuver
Copy link
Member

@fkleuver fkleuver commented Oct 9, 2018

No description provided.

@codeclimate
Copy link

codeclimate bot commented Oct 9, 2018

Code Climate has analyzed commit 87635f5 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 91.2% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.9% (0.4% change).

View more on Code Climate.

@codecov
Copy link

codecov bot commented Oct 9, 2018

Codecov Report

Merging #213 into master will increase coverage by 0.31%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #213      +/-   ##
==========================================
+ Coverage   90.08%   90.39%   +0.31%     
==========================================
  Files          83       83              
  Lines        6744     6809      +65     
  Branches     1132     1139       +7     
==========================================
+ Hits         6075     6155      +80     
+ Misses        669      654      -15
Impacted Files Coverage Δ
packages/runtime/src/binding/ast.ts 92.39% <100%> (+4.09%) ⬆️
packages/jit/src/expression-parser.ts 100% <100%> (ø) ⬆️
packages/runtime/src/binding/expression-parser.ts 78.31% <100%> (-0.26%) ⬇️
packages/runtime/src/binding/binding.ts 97.56% <100%> (+1.26%) ⬆️
packages/runtime/src/binding/ref.ts 20.68% <20%> (-0.15%) ⬇️
...ime/src/binding/resources/self-binding-behavior.ts 66.66% <57.14%> (ø) ⬆️
packages/runtime/src/binding/listener.ts 81.81% <66.66%> (-2.8%) ⬇️
packages/runtime/src/binding/call.ts 94.44% <81.81%> (-5.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e804a0...87635f5. Read the comment docs.

@AureliaEffect
Copy link
Member

This pull request fixes 2 alerts when merging 5bd30eb into 1e804a0 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

Comment posted by LGTM.com

@fkleuver
Copy link
Member Author

fkleuver commented Oct 9, 2018

@EisenbergEffect @bigopon This is just some leftover work in progress I had on the previous PR. It's ready now. Ish. I will finish up the AST tests later, getting a bit bored of it :)

@AureliaEffect
Copy link
Member

This pull request fixes 2 alerts when merging cc8bb7d into 1e804a0 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

Comment posted by LGTM.com

BindingIdentifier = 0b0010000000_10110,
ForOfStatement = 0b0000100000_10111,
Interpolation = 0b0000001000_11000
Connects = 0b000000000001_00000, // The expression's connect() function is not a no-op
Copy link
Member

Choose a reason for hiding this comment

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

nit: Maybe highlight not by uppercasing it. very easy to miss this important signal

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah agree. I just made the comment a bit more informative and consistent with the rest. "not a no-op" was a bit lackluster in info anyway

Copy link
Member

Choose a reason for hiding this comment

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

While we are here, should we also try to make it consistent the way we want to have instance constant. Current its different between instruction and AST?

const $emptyObject = new ObjectLiteral(PLATFORM.emptyArray, PLATFORM.emptyArray);
const $emptyTemplate = new Template(['']);

Object.defineProperty(AccessThis, '$this', { value: $this, writable: false, enumerable: true, configurable: false });
Copy link
Member

Choose a reason for hiding this comment

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

Well, maybe change the block to something like this: it looks too bulky

((dP, baseConfig) => {
  baseConfig.value = ....
  dP(Class, prop, baseCfg);
})(Object.defineProperty, { value: null, writeable: fasle, enumerable: true, configurable: false } );

Copy link
Member

Choose a reason for hiding this comment

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

On a second thought, do we need this setup? Wouldn't a normal assignment be enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I can't really make up my mind on that either. I had static readonly ... = new ... first. I changed it because I had this vague worry about assigning them statically before the other prototype modifications down below were done. Not really any actual basis for that though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay I made up my mind. They're static properties now. I really don't see much point in defining them via reflection as they're already marked readonly.

Copy link
Member

@bigopon bigopon left a comment

Choose a reason for hiding this comment

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

I like the PR and its polishing touches, both the tests and src. lgtm.

@fkleuver fkleuver changed the title Binding tests #2 feat(binding): improve AST $kind classifying and other small tweaks/fixes Oct 9, 2018
@AureliaEffect
Copy link
Member

This pull request fixes 2 alerts when merging 8e5ae9e into 1e804a0 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

Comment posted by LGTM.com

@AureliaEffect
Copy link
Member

This pull request fixes 2 alerts when merging 738e0f7 into 1e804a0 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

Comment posted by LGTM.com

@AureliaEffect
Copy link
Member

This pull request fixes 2 alerts when merging 33d9431 into 1e804a0 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

Comment posted by LGTM.com

@AureliaEffect
Copy link
Member

This pull request fixes 2 alerts when merging 87635f5 into 1e804a0 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

Comment posted by LGTM.com

@EisenbergEffect
Copy link
Contributor

Very nice!

@EisenbergEffect EisenbergEffect merged commit 7267165 into master Oct 9, 2018
@EisenbergEffect EisenbergEffect deleted the binding-tests-2 branch October 9, 2018 23:33
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.

None yet

4 participants