-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add interop for Atomics #85
Conversation
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.
Thanks, this looks good, just have a few minor comments. PTAL.
node_interop/lib/atomics.dart
Outdated
// Copyright (c) 2020, Anatoly Pulyaevskiy. All rights reserved. Use of this source code | ||
// is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
||
/// Bindings for the Atomics JavaScript obect. Since this object only has static |
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.
typo: obect
=> object
.
node_interop/lib/atomics.dart
Outdated
|
||
/// Bindings for the Atomics JavaScript obect. Since this object only has static | ||
/// methods, it's exposed as a module so that it can be used in the standard | ||
/// Dart style. |
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.
One thing I prefer to preserve, if possible, is to keep bindings closer to the actual JS API. What do you think of adding a container Atomics
abstract class and making the below methods static inside it? I think JS interop supports external static methods, but I'm not 100% sure.
node_interop/lib/atomics.dart
Outdated
/// methods, it's exposed as a module so that it can be used in the standard | ||
/// Dart style. | ||
@JS() | ||
library node_interop.atomics; |
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.
Also, it looks like Atomics is a global JS object, so we need to add an export of atomics in lib/node.dart
which is where all the global stuff is exported.
Moved it into |
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, build failure is unrelated to this change (and is rather weird, pub installs build_modules 2.11.0 when it can install 2.11.1, which is what happens locally and resolves the issue).
Merging. Thanks again!
No description provided.