This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Refactor JSNumber.toDart and Object.toJS #43149
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
srujzs
commented
Jun 23, 2023
@@ -12,8 +12,7 @@ import 'platform_dispatcher.dart'; | |||
import 'safe_browser_api.dart'; | |||
|
|||
@JS('window._flutter_internal_on_benchmark') | |||
external JSAny? get _onBenchmark; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do note that this means there is a proper box in JS now for this code. It doesn't seem like there will be performance implications but I'm not entirely sure. Here is the framework PR that needs to be landed after this one: flutter/flutter#129436. If we're worried about performance, I'm happy to use the helpers like toObjectShallow
there, but the framework will need to know whether the platform is Wasm or not to reuse those helpers.
JSNumber.toDart will now be two functions: toDartDouble and toDartInt. Note that some code that looks like `toDart.toInt()` was kept as `toDartDouble.toInt()` instead of `toDartInt`, since `toDartInt` throws if the value is not an integer. Object.toJS is now Object.toJSBox. An actual box is introduced on all backends now, and is unwrapped in JSBoxedDartObject.toDart. There are many usages of toJSAnyShallow that we should modify, but that's for a later CL.
@eyebrowsoffire PTAL, thanks! |
eyebrowsoffire
approved these changes
Jun 26, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 26, 2023
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jun 26, 2023
…129593) flutter/engine@0da06de...715eff2 2023-06-26 58529443+srujzs@users.noreply.github.com Refactor JSNumber.toDart and Object.toJS (flutter/engine#43149) 2023-06-26 jonahwilliams@google.com [Impeller] Treat SubOptimalKHR as rotated. (flutter/engine#43214) 2023-06-26 skia-flutter-autoroll@skia.org Roll ANGLE from f6c7dc891859 to 4a4b13cc6931 (12 revisions) (flutter/engine#43213) 2023-06-26 skia-flutter-autoroll@skia.org Roll Skia from 632fa401098d to 4ae209493390 (3 revisions) (flutter/engine#43212) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jsimmons@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
8 tasks
auto-submit bot
pushed a commit
that referenced
this pull request
Jun 27, 2023
Reverts #43149 Reason for reverting: Broke the roll into the framework.
kjlubick
pushed a commit
to kjlubick/engine
that referenced
this pull request
Jul 14, 2023
JSNumber.toDart will now be two functions: toDartDouble and toDartInt. Note that some code that looks like `toDart.toInt()` was kept as `toDartDouble.toInt()` instead of `toDartInt`, since `toDartInt` throws if the value is not an integer. Object.toJS is now Object.toJSBox. An actual box is introduced on all backends now, and is unwrapped in JSBoxedDartObject.toDart. There are many usages of toJSAnyShallow that we should modify, but that's for a later CL. This is to help land this CL: https://dart-review.googlesource.com/c/sdk/+/309082 https://dart-review.googlesource.com/c/sdk/+/309081 is the CL that added the new methods. ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [X] I listed at least one issue that this PR fixes in the description above. - [ ] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [X] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing.
kjlubick
pushed a commit
to kjlubick/engine
that referenced
this pull request
Jul 14, 2023
Reverts flutter#43149 Reason for reverting: Broke the roll into the framework.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JSNumber.toDart will now be two functions: toDartDouble and toDartInt. Note that some code that looks like
toDart.toInt()
was kept astoDartDouble.toInt()
instead oftoDartInt
, sincetoDartInt
throws if the value is not an integer.Object.toJS is now Object.toJSBox. An actual box is introduced on all backends now, and is unwrapped in JSBoxedDartObject.toDart. There are many usages of toJSAnyShallow that we should modify, but that's for a later CL.
This is to help land this CL: https://dart-review.googlesource.com/c/sdk/+/309082
https://dart-review.googlesource.com/c/sdk/+/309081 is the CL that added the new methods.
Pre-launch Checklist
///
).