Pergunta

For my sanity, can someone verify a strange bug I'm having with the dart editor?

I'm using the latest dart editor from the main page of the website, I downloaded, extracted, then ran the "DartEditor" executable. (I didn't clear any previous settings that were stored elsewhere, but I don't think that will change the issue.)

Dart Editor version 1.0.0_r30798 (STABLE)
Dart SDK version 1.0.0.10_r30798
  • Download my repository: https://github.com/Naddiseo/dart-sprintf.git
  • Switch to the debugger_ide_test branch
  • On console (not in the editor) run dart test/sprintf_test.dart The output should be:

    decimal=1, exp=0, digits=[5, 4, 6, 6]

  • Next, fire up the editor, and open the folder.

  • Run the same file, and it should print out the same result.
  • Now for the weird part. Set a break point in lib/src/formatters/float_formatter.dart:17 which is the first line of the constructor.
  • Run the test file in the editor again then continue once it gets the break point.

With the breakpoint I'm getting the following output:

decimal=1, exp=0, digits=[0, 0, 5, 4, 6, 6]

I've attributed it to the List<String> constructor, which seems to initialise to not be empty.

Does anyone else get this problem? I've tried to condense this into a testable single file, but have failed to reproduce; I'm only able to reproduce it in the actual project.

Foi útil?

Solução

Definitely sounds like a bug. As Fox32 suggests, please file a bug on http://dartbug.com/new.

Generally these kind of bugs happen for two reasons:

  • The debugger has a side-effect: if the debugger (here the Dart-editor) invokes the actual toString method on visible variables, it could have a side-effect. Most commonly this happens to Iterables that have a side-effect.
  • The VM has a bug when debugging. The VM has to compile code differently (for example disable some optimizations) to stop at any arbitrary location. It could be that your breakpoint triggers a bug there.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top