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

Fix dictionary constructors to accept supertype members and create an empty object when there are no fields #197

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

srujzs
Copy link
Contributor

@srujzs srujzs commented Mar 5, 2024

Dictionaries can contain their supertypes' members as well and therefore, these constructors should accept them.

https://webidl.spec.whatwg.org/#idl-dictionaries
#188

We also emit some empty dictionary constructors, but because they are empty, they are treated as named constructors instead of object literal constructors. They should instead call JSObject() to create an empty object.

Since some supertype fields are marked required, this is technically a breaking change as calling the same dictionary constructor requires those members now. Therefore, bump to 0.6.0-wip.

Dictionaries can contain their supertypes' members as well and
therefore, these constructors should accept them.

https://webidl.spec.whatwg.org/#idl-dictionaries
These members should just initialize the representation field
as an empty object.
@srujzs srujzs requested a review from sigmundch March 5, 2024 20:04
Copy link
Member

@sigmundch sigmundch left a comment

Choose a reason for hiding this comment

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

THanks!

@srujzs srujzs merged commit 51e594b into dart-lang:main Mar 5, 2024
9 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Mar 7, 2024
…h, web, webdriver, webkit_inspection_protocol

Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/cec45fb..0de8aff):
  0de8aff3  2024-03-06  Sam Rawlins  Generate docs for enum static methods. (dart-lang/dartdoc#3697)
  9eafdc64  2024-03-06  Sam Rawlins  Rewrite Library.allOriginalModelElementNames. (dart-lang/dartdoc#3698)
  e8f36333  2024-03-06  Sam Rawlins  Fix SDK GitHub action with some stub headers and footers (dart-lang/dartdoc#3704)
  58c065d4  2024-03-05  Sam Rawlins  Bump snippets activated to 0.4.3 (dart-lang/dartdoc#3702)

http (https://github.com/dart-lang/http/compare/470d2c3..8d3c647):
  8d3c647  2024-03-06  Brian Quinlan  Add support for negotiating a subprotocol (dart-lang/http#1150)
  e71e739  2024-03-05  Brian Quinlan  Add `WebSocket.connect` as a cross-platform connection method (dart-lang/http#1149)
  f14b5aa  2024-03-04  Brian Quinlan  Include a description and version number in web_socket pubspec (dart-lang/http#1148)
  5b656a9  2024-03-04  Brian Quinlan  Add a LICENSE file to package:web_socket (dart-lang/http#1147)
  557c420  2024-03-04  Brian Quinlan  Implement WebSocket for the browser (dart-lang/http#1142)

markdown (https://github.com/dart-lang/markdown/compare/dd47c5d..1ca5166):
  1ca5166  2024-03-06  Devon Carew  fix a crash when parsing alert block syntax (dart-lang/markdown#593)

package_config (https://github.com/dart-lang/package_config/compare/4a7042b..3d90e69):
  3d90e69  2024-03-05  Michael Thomsen  Fix typo (dart-lang/package_config#149)

shelf (https://github.com/dart-lang/shelf/compare/da6a69b..1acbc67):
  1acbc67  2024-03-06  Andy  Add shelf_router middleware examples (dart-lang/shelf#417)

vector_math (https://github.com/google/vector_math.dart/compare/3706feb..7e705f7):
  7e705f7  2024-03-06  6y  Fix quaternion negate (google/vector_math.dart#316)
  1ed8ac6  2024-03-06  6y  Resolve Inconsistency in Matrix3 and Matrix4 `rotateY` Implementations (google/vector_math.dart#317)

web (https://github.com/dart-lang/web/compare/8870d04..51e594b):
  51e594b  2024-03-05  Srujan Gaddam  Fix dictionary constructors to accept supertype members and create an empty object when there are no fields (dart-lang/web#197)
  4af904f  2024-03-05  Srujan Gaddam  Publish 0.5.1 (dart-lang/web#196)
  c72ec1a  2024-03-04  Devon Carew  add instructions for re-generating the package (dart-lang/web#195)

webdriver (https://github.com/google/webdriver.dart/compare/2c1b6f8..73a7ac8):
  73a7ac8  2024-03-04  dependabot[bot]  Bump nanasess/setup-chromedriver from 2.2.1 to 2.2.2 (google/webdriver.dart#294)

webkit_inspection_protocol (https://github.com/google/webkit_inspection_protocol.dart/compare/07295b9..153fea4):
  153fea4  2024-03-04  dependabot[bot]  Bump nanasess/setup-chromedriver (google/webkit_inspection_protocol.dart#120)

Change-Id: Ic213677a1e2430a6de56a94e0bfaa1f33e2fc7d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356300
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Mar 26, 2024
Revisions updated by `dart tools/rev_sdk_deps.dart`.

crypto (https://github.com/dart-lang/crypto/compare/f059196..69d13c9):
  69d13c9  2024-03-21  Kevin Moore  Switch sha512 to use fastpath with wasm (dart-lang/crypto#165)

csslib (https://github.com/dart-lang/csslib/compare/b58e487..4216525):
  4216525  2024-03-21  Devon Carew  prep for publishing 1.0.1 (dart-lang/csslib#197)

dartdoc (https://github.com/dart-lang/dartdoc/compare/7be9e24..79c1675):
  79c16759  2024-03-25  Parker Lougheed  Migrate client code to package:web (dart-lang/dartdoc#3610)
  0b1c7fa4  2024-03-25  dependabot[bot]  Bump actions/cache from 4.0.1 to 4.0.2 (dart-lang/dartdoc#3734)
  9fe35ec5  2024-03-20  Sam Rawlins  mustachio: Separate out the context stack LUB type calculation (dart-lang/dartdoc#3730)

http (https://github.com/dart-lang/http/compare/5dfea72..7949d6f):
  7949d6f  2024-03-25  Brian Quinlan  cupertino_http: upgrade ffigen version (dart-lang/http#1159)
  051482a  2024-03-22  Brian Quinlan  Ready cupertino_http for release with WebSocket support (dart-lang/http#1158)
  988b4d4  2024-03-20  Brian Quinlan  Prepare package:cronet_http 1.2 for release (dart-lang/http#1157)
  69f4eff  2024-03-20  Hossein Yousefi  [cronet_http] Upgrade jni to 0.7.3 (dart-lang/http#1156)
  d8b1a9e  2024-03-19  Brian Quinlan  Release `package:web_socket` 0.1.0 (dart-lang/http#1155)
  cfbc191  2024-03-19  Brian Quinlan  Add a WebSocket implementation to package:cupertino_http (dart-lang/http#1153)

markdown (https://github.com/dart-lang/markdown/compare/9c6b1af..8d07abc):
  8d07abc  2024-03-19  MJ Studio  Link uri encoding, URL-escaping should be left alone inside the destination (dart-lang/markdown#598)

web (https://github.com/dart-lang/web/compare/4af904f..c522718):
  c522718  2024-03-20  Kevin Moore  Update MDN documentation (dart-lang/web#213)
  f80dcab  2024-03-15  Srujan Gaddam  Update pubspec description to be consistent with README (dart-lang/web#210)
  27936c4  2024-03-15  Devon Carew  Generate api docs for getters (dart-lang/web#207)
  2f13cd5  2024-03-12  Devon Carew  fix unresolved dartdoc links (dart-lang/web#200)
  686827a  2024-03-12  Srujan Gaddam  Remove reference to static interop and point to dart.dev page for JS interop (dart-lang/web#206)
  9b7e29d  2024-03-12  Devon Carew  Add a 'sourced from mdn docs' line to the MDN sourced dartdoc (dart-lang/web#198)
  51e594b  2024-03-05  Srujan Gaddam  Fix dictionary constructors to accept supertype members and create an empty object when there are no fields (dart-lang/web#197)

Change-Id: Ic90c6f5a7e7d701746276031a8028cdfe76bc27a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
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.

3 participants