Skip to content

Should dart:core print() be user-redefinable?  #3486

@DartBot

Description

@DartBot

This issue was originally filed by renggli...@gmail.com


What steps will reproduce the problem?

<!DOCTYPE html>
<html>
  <head>
    <title>Some Tests</title>
  </head>
  <body>
    <h1>Some Tests</h1>
    <pre id="log"></pre>
    <script type="text/javascript">
        if (console) {
            var log = console.log;
            var element = document.getElementById('log');
            console.log = function(text) {
                element.appendChild(document.createTextNode(text + '\n'));
                log.apply(this, arguments);
            }
        }
    </script>
    <script type="application/dart" src="SomeTests.dart"></script>
    <script src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js&quot;&gt;&lt;/script>
  </body>
</html>

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

I can redefine console.log to see the console output as part of the HTML page. This works well when the Dart code is run as Javascript in the standard Chrome browser, but fails to have any effect when run with the Chromium browser with the built-in Dart VM.

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

Dart SDK version 8344
Chromium Version 21.0.1165.0 (140714)

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-coretype-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions