Skip to content

dart2js bug with Random.nextInt((1<<32)-1) #5827

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. Use the code :

import('dart:math');

num newId(){
  var id = new Random();
  return id.nextInt((1<<32)-1);
}

main(){
  var id = newId();
  print(id);
}

  1. Run dart2js
  2. Launch with Chrome

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

I expect a random integer.
I see nothing.

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

Dart Edidor Version 0.1.0.201210082016, build 13393
Dart SDK version 13387
OS : ubuntu 12.04 64bits

Please provide any additional information below.

The code above works with Dart alone, but the javascript version doesn't.
If we replace (1<<32)-1 by (1<<31)-1 the javascript works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions