Skip to content

Instantly share code, notes, and snippets.

@joelthelion
Forked from munificent/HelloDartTest.dart
Created November 22, 2011 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelthelion/1385616 to your computer and use it in GitHub Desktop.
Save joelthelion/1385616 to your computer and use it in GitHub Desktop.
Dart Compilation
// ********** Library dart:core **************
// ********** Natives dart:core **************
// ********** Code for Object **************
// ********** Code for BadNumberFormatException **************
function BadNumberFormatException() {}
// ********** Code for top level **************
function print(obj) {
if (typeof console == 'object') {
if (obj) obj = obj.toString();
console.log(obj);
} else {
write(obj);
write('\n');
}
}
// ********** Library dart:coreimpl **************
// ********** Code for NumImplementation **************
NumImplementation = Number;
// ********** Code for StringImplementation **************
StringImplementation = String;
StringImplementation.prototype.contains = function(pattern, startIndex) {
return this.indexOf(pattern, startIndex) >= 0;
}
// ********** Code for top level **************
// ********** Library hello **************
// ********** Code for HelloDartTest **************
function HelloDartTest() {}
HelloDartTest.testMain = function() {
print("Hello, Darter!");
}
// ********** Code for top level **************
function main() {
HelloDartTest.testMain();
}
main();
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// Compiled using frog, the in-progress self-hosted compiler:
// dart/frog$ ./frogsh --out=hello.js --compile-only samples/hello.dart
class HelloDartTest {
static testMain() {
print("Hello, Darter!");
}
}
main() {
HelloDartTest.testMain();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment