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

dart2js treats (some) unsigned 32-bit integers as non ints #2983

Closed
DartBot opened this issue May 9, 2012 · 10 comments
Closed

dart2js treats (some) unsigned 32-bit integers as non ints #2983

DartBot opened this issue May 9, 2012 · 10 comments
Assignees
Labels
closed-duplicate Closed in favor of an existing report web-dart2js
Milestone

Comments

@DartBot
Copy link

DartBot commented May 9, 2012

This issue was originally filed by @bp74


What steps will reproduce the problem?

  1. run the following code

class Test {
  static final int Black = 0xFF000000;
}
testInt(var value) {
  print("value is an int: ${value is int}");
}
void main() {
  int x = Test.Black;
  testInt(x);
}

What is the expected output? What do you see instead?

The Dart-VM says: "value is an int: true"
compiled with frog: "value is an int: true"
compiled with dart2js: "value is an int: false"

Tested in Chrome 18, IE 9, Firefox 12.

What version of the product are you using? On what operating system?

Dart Editor Buid 7466 32 bit, Windows 7 64 bit

@rakudrama
Copy link
Member

Added Area-Dart2JS, Triaged labels.

@DartBot
Copy link
Author

DartBot commented May 9, 2012

This comment was originally written by @bp74


Here is a simplified version of the test.
It's more obvious where the problem is:

testInt(var value) {
  print("value is an int: ${value is int}");
}

void main() {
  testInt(1);
  testInt(0xFFFFFFFF);
  testInt(0x1FFFFFFF);
}

-->
value is an int: true
value is an int: false
value is an int: true

Well, the value 0xFFFFFFFF (which could be -1 if you say it's 32 bit int) is not an int when compiled with dart2js.

@floitschG
Copy link
Contributor

Dart2js currently only considers 31 bits as integers.
I will see if we can make improvements to get to the full range of 53 bits (maximum integer a double can represent without loss of precision).

@kasperl
Copy link

kasperl commented May 14, 2012

Set owner to @floitschG.
Added Accepted label.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Added this to the M1 milestone.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Changed the title to: "dart2js treats (some) unsigned 32-bit integers and non ints".

@floitschG
Copy link
Contributor

Issue #3720 has been merged into this issue.

@floitschG
Copy link
Contributor

Related (potentially duplicate): issue #3814

@kasperl
Copy link

kasperl commented Sep 7, 2012

Changed the title to: "dart2js treats (some) unsigned 32-bit integers as non ints".

@kasperl
Copy link

kasperl commented Sep 7, 2012

I don't think there's an extra information in here not covered by issue #3814. Marking as a duplicate.


Added Duplicate label.
Marked as being merged into #3814.

@DartBot DartBot added Type-Defect web-dart2js closed-duplicate Closed in favor of an existing report labels Sep 7, 2012
@DartBot DartBot added this to the M1 milestone Sep 7, 2012
dart-bot pushed a commit that referenced this issue Jun 4, 2021
New commits include:
```
git log --format="%C(auto) %h %s" 11c2a0978e66fbc2c182dc6a8174db1a3651276c..3c14d86a67db7207bbc9f654ac49ee60e08e5240
 3c14d86a Test cases with core.ignoreCase = true / false (#3025)
 937cd3be Fix CR LF in .gitignore / .pubignore (#3026)
 610254f7 Add test to ignore dot-files (#2983)
 c24d7478 Fixes linter warnings (#3021)
```

Change-Id: I49f0fc3a2360b0e1e4e009a4fff2a702163cd6b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202481
Auto-Submit: Jonas Jensen <[email protected]>
Commit-Queue: Jonas Jensen <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
Reviewed-by: Alexander Thomas <[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
closed-duplicate Closed in favor of an existing report web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants