Hi, I'm trying to create a interface Printer with a method print. One of Printer implementations is ConsolePrinter, I need it to print to the console, with the global print(string) function.
interface Printer {
print(message);
}
class ConsolePrinter implements Printer {
print(message) =>
/*global*/ print(message);
}
main() {
new ConsolePrinter().print("Hi");
}
The problem is obiously than this line
print(message) =>
/*global*/ print(message);
(Warning: Execute this code will fill Javascript callstack)
Is recursive, I don't want to so...
How can I access global "print" function from a class who already has a "print" method?
---
A. Matías Quezada