Skip to content

Instantly share code, notes, and snippets.

@ochafik

ochafik/Bar.js Secret

Created August 6, 2015 16:27
Show Gist options
  • Select an option

  • Save ochafik/dcba6be9e11b1f488aff to your computer and use it in GitHub Desktop.

Select an option

Save ochafik/dcba6be9e11b1f488aff to your computer and use it in GitHub Desktop.
needle
// Compiled from Dart by Needle: DO NOT EDIT.
goog.require("dart.runtime");
goog.require("dart.core");
goog.require("dart.core.Object");
goog.provide("Bar");
/** @constructor @struct @extends {dart.core.Object} */
var Bar = function() {
goog.base(this);
};
goog.inherits(Bar, dart.core.Object);
// Compiled from Dart by Needle: DO NOT EDIT.
goog.require("dart.runtime");
goog.require("dart.core");
goog.require("dart.core.Object");
goog.provide("Baz");
/** @constructor @struct @extends {dart.core.Object} */
var Baz = function() {
goog.base(this);
};
goog.inherits(Baz, dart.core.Object);
// Compiled from Dart by Needle: DO NOT EDIT.
goog.require("dart.runtime");
goog.require("dart.core");
goog.require("Bar");
goog.require("Baz");
goog.provide("Foo");
/**
* @implements {Baz}
* @constructor @struct @extends {Bar}
*/
var Foo = function() {
goog.base(this);
};
goog.inherits(Foo, Bar);
dart.runtime.mixin(Foo, [Baz]);
/**
* @this {Foo}
* @param {string} message
* @param {{loud: ?boolean}=} opt_namedArgs
*/
Foo.prototype.log = function(message, opt_namedArgs) {
var loud = opt_namedArgs && opt_namedArgs.loud;
if (!goog.isDef(loud)) loud = false;
dart.runtime.print(dart.runtime.interpolate("[", dart.runtime.notNullBoolean(loud) ? "SHOUT" : "INFO", "]: ", message));
};
dart.runtime.extend(Foo.prototype, /** @lends {Foo.prototype} */
({
/**
* @this {Foo}
* @return {!dart.runtime.FunctionSignature}
*/
get log$signature() {
return new dart.runtime.FunctionSignature([
dart.core.String
], [], {
loud: dart.core.bool
});
}
}));
class Bar {}
class Baz {}
class Foo extends Bar with Baz {
log(String message, {bool loud: false}) {
print('[${loud ? 'SHOUT' : 'INFO'}]: $message');
}
}
run(x) {
x.log('Hello', loud: true);
}
main() {
dynamic f;
var foo = new Foo();
run(foo);
foo.log('Hello', loud: true);
}
// Compiled from Dart by Needle: DO NOT EDIT.
goog.require("dart.runtime");
goog.require("dart.core");
goog.require("Foo");
goog.provide("dart.global.run");
goog.provide("dart.global.main");
dart.global.run = function(x) {
dart.runtime.callUnknownMethod(x, [
"Hello",
{loud: true}
], x.log, {log: 0}, x.log$signature);
};
dart.global.main = function() {
var f;
/** @type {Foo} */
var foo = new Foo();
dart.global.run(foo);
foo.log("Hello", {loud: true});
};
dart.runtime.registerSymbolsForNoSuchMethod({log: 0}, {});
dart.global.main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment