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

Provide "toCharCode" to complement String.fromCharCode #958

Closed
DartBot opened this issue Dec 25, 2011 · 5 comments
Closed

Provide "toCharCode" to complement String.fromCharCode #958

DartBot opened this issue Dec 25, 2011 · 5 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Dec 25, 2011

This issue was originally filed by [email protected]


The String class provides fromCharCode, but has no matching toCharCode. The lack of this is a JavaScriptism, but it's useful to provide this for handling control characters. GWT provides this by allowing casts from char to int and generates the JS with the appropriate integer.

@DartBot
Copy link
Author

DartBot commented Dec 25, 2011

This comment was originally written by [email protected]

@DartBot
Copy link
Author

DartBot commented Dec 25, 2011

This comment was originally written by [email protected]


How would this be different from the existing String.charCodeAt(int index)?

@dgrove
Copy link
Contributor

dgrove commented Jan 2, 2012

Added Area-Library, Triaged labels.

@andersjohnsen
Copy link

String now have a 'charCodes' getter. I'm not sure when it was introduced, but closing issue.


Added Fixed label.

@DartBot DartBot added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Jan 3, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
@stevenspiel
Copy link

stevenspiel commented Jul 23, 2019

I believe codeUnits is now the getter

String.fromCharCodes("foo".codeUnits) == "foo"

dart-bot pushed a commit that referenced this issue Nov 6, 2020
2020-11-05 [email protected] Fixes #602: New tests for least and greatest closures added.
2020-11-05 [email protected] #926. Rewrite io/Process/start_A01_t02 test to work on precompiled environment
2020-11-05 [email protected] #932. Rewrite HttpRequestUpload/onLoad_A01_t01 test to send correct HttpRequest
2020-11-04 [email protected] Fixes #956. Don't expect extension invocation on type dynamic
2020-11-04 [email protected] Convert some multi-tests to static error framework  (#958)
2020-11-03 [email protected] Fixes #602: dynamic tests for least and greatest closures updated.
2020-11-03 [email protected] Fixes #602: tests for least and greatest closures added.
2020-10-28 [email protected] #926. Fix two Process tests to use 'process_test' tool
2020-10-28 [email protected] #926. Rewrite two Process tests to use 'process_test' tool
2020-10-28 [email protected] Fixes #955. Expect less specific error for typed_data tests
2020-10-26 [email protected] Fixes #954. Change the line where we expect an error for CFE
2020-10-20 [email protected] Fixes #912. Abstract variables syntax tests added
2020-10-19 [email protected] #912. More external variables syntax tests added
2020-10-17 [email protected] External variables syntax test added
2020-10-16 [email protected] #912. More test for static analysis of external variables added
2020-10-15 [email protected] #912. Test for static analysis of external variables added
2020-10-14 [email protected] #912. Test for static analysis if abstract variables added

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,analyzer-nnbd-win-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,front-end-nnbd-win-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: Id9cde784918faa4e891da8c4cb448d415a7a18aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170680
Reviewed-by: William Hesse <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jun 12, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/2a39574..5799424):
  57994242  2023-06-09  Parker Lougheed  Remove old <nodoc> syntax (#3261)

http (https://github.com/dart-lang/http/compare/5312366..ba7eb60):
  ba7eb60  2023-06-09  Brian Quinlan  Run common URLSessionTask tests on URLSessionWebSocketTask (#959)
  1746017  2023-06-09  Brian Quinlan  Support delegate methods for WebSocketTask (#958)

mockito (https://github.com/dart-lang/mockito/compare/cca4858..1d6064a):
  1d6064a  2023-06-09  Nate Bosch  Prepare to publish

webdev (https://github.com/dart-lang/webdev/compare/a6d761d..81ae77a):
  81ae77aa  2023-06-09  Elliott Brooks  Update Dart Debug Extension version in preparation for publishing (#2139)
  bb9265a0  2023-06-09  Elliott Brooks  Update DCM workflow (#2135)
  7652f646  2023-06-09  Elliott Brooks  Double the timeout for the webdev installation test (#2137)

Change-Id: I9d775bbb5c8a710a3339fa3434a95e8e0f2af75c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308760
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants