Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Google Dart
#7
There are binaries for the Dart editor available now. It checks for errors on saving a file (as opposed to as you type), has completion after typing a "." (but not before unless you press ctrl+space), F3 to jump to the declaration of something, and has a button for compiling to javascript and viewing the page in a browser.

Something that tripped me up is that the Hello World in the new project template does not work in Firefox or IE because it uses the innerText property, which I now know is non-standard.

Code:
#import('dart:dom');

class HelloWorld {

  HelloWorld() {
  }

  void run() {
    write("Hello World!");
  }

  void write(String message) {
    // the DOM library defines a global "window" variable
    HTMLDocument doc = window.document;
    HTMLParagraphElement p = doc.createElement('p');
    p.innerText = message;
    doc.body.appendChild(p);
  }
}

void main() {
  new HelloWorld().run();
}
Reply


Messages In This Thread
Google Dart - by Spaz - 2011-10-21, 11:11 PM
Google Dart - by Nikkey - 2011-10-23, 05:33 PM
Google Dart - by Spaz - 2011-10-23, 07:10 PM
Google Dart - by Nikkey - 2011-10-23, 07:40 PM
Google Dart - by Spaz - 2011-10-23, 08:26 PM
Google Dart - by Nikkey - 2011-10-24, 01:44 PM
Google Dart - by Spaz - 2011-11-07, 11:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)