Commit Graph

15 Commits

Author SHA1 Message Date
Srujan Gaddam 8e663541c9 [ddc] Change is checks for JS types
Changes 'is' checks for JS types such that it no longer does an
instance of check and instead only checks to see if the object
in question is a JS object or appropriate subtype. This means that
any two @JS objects will pass an is check and therefore can be
casted as one another. This makes it consistent with expected
behavior and dart2js.

Also amends the README to reflect the unified behavior.

Change-Id: I11aa105d6cafbbafde482b27dcc1182c0960cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173140
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-10 01:38:26 +00:00
Nate Bosch 97cf54c58e Remove some stale JS interop known differences
Remove sections describing differences between dart2js and ddc that
have since been resolved.

Both ddc and dart2js will require use of `allowInterop` in all but
unlikely edge cases. Both will be strict about argument types and count
as long as `allowInterop` is used.

Other fixes:
- Fix spelling of "supersedes".
- Use `List.from` over `list.cast().toList()` in example.

Change-Id: If4ce0926a4460ed41ddea2714ee3324c60770d62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136844
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-26 00:52:43 +00:00
Kathy Walrath 0f109da0d1 Updating the package:js README
Closes #37883
https://github.com/dart-lang/sdk/pull/37883

GitOrigin-RevId: e14be88991f39db80422e98399fab26c8e9c038e
Change-Id: Ic4e45420dcf6fe71b5c215c435cd72ffb6e665f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113265
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2019-08-19 17:52:57 +00:00
Nate Bosch 60e474bf7a Add section on known bugs
For now stage this in the package:js README - that might not be the best
place for it long term since the details may change...

- Add a note that makes it explicit we expect all interop to use
  `package:js` instead of `dart:js`.
- Add notes about known limitations and differences between dart2js and
  DDC.

Change-Id: Ib4c967ea1435dd85f41f56646140352b125cee4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107560
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-27 23:38:43 +00:00
Nate Bosch ec160b74dc Start cleaning up docs in package:js
- Remove some unnecessary details in the README. The SDK constraint
  duplicates the pubspec, the dependencies section duplicates automatic
  info on the pub site, and the contributing section duplicates generate
  Dart/SDK contributing information. The issue link is still useful
  since it fills in a template, but we should update it to include a
  label by default.
- Use "JavaScript" consistently in docs.
- Rephrase some doc comments for clarity.
- Drop `new` from examples.
- Use consistent single quotes in examples.
- Always show the `@JS()` annotation on `library` in examples.
- Move the note about factory constructors for anonymous classes to the
  annotation from the README.
- Bump the mimimum SDK to`2.0.0` since there isn't utility in claiming
  support for older SDKs.

There are stale docs remaining in the `varargs.dart` library that should
be handled separately by deleting that library.

Change-Id: Ida51d2ec3fd31210b55dc91042a0ac1cf77210b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107450
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-06-27 21:36:54 +00:00
Alexandre Ardhuin 3f1720069a Add a note on the README of js package (#27701) 2016-11-23 16:36:54 +01:00
Danny Tuppeny 984f5c928d Added js import to sample code. (#26985)
This import seems to be required for the sample code to pass the analyzer.
2016-08-22 09:20:06 -07:00
Nathan Kerr 83d8f91397 Remove duplicate word 2015-11-19 14:06:01 -08:00
Kevin Moore 3d43d6d51c pkg/js: prepare for 0.6.0 release
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1456223002 .
2015-11-18 15:34:54 -08:00
Kevin Moore 87fc010974 pkg/js: moved example code to https://github.com/google/chartjs.dart/
R=jacobr@google.com

Review URL: https://codereview.chromium.org/1449053004 .
2015-11-17 11:11:07 -08:00
Kevin Moore e7e012e386 fix readme for pkg/js and prepare another release
Update SDK changelog to mention improved JS interop

R=jacobr@google.com

Review URL: https://codereview.chromium.org/1438003002 .
2015-11-11 12:19:43 -08:00
Kevin Moore e32d7d7029 pkg/js: add link to example
Review URL: https://codereview.chromium.org/1406093002 .
2015-10-15 16:33:05 -07:00
Kevin Moore 045325b32e pkg/js: improved readme, added example
R=jacobr@google.com

Review URL: https://codereview.chromium.org/1411503002 .
2015-10-15 14:51:35 -07:00
Kevin Moore 9e8c868c3b Big cleanup to README. Added CHANGELOG.
R=jacobr@google.com

Review URL: https://codereview.chromium.org/1404873004 .
2015-10-15 10:46:58 -07:00
Jacob Richman cd2752431e Support user generated custom native JS classes.
BUG=
R=jmesserly@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1318043005 .
2015-10-13 13:15:28 -07:00