This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //supports dot path resolution, function eval, and searching global paths | |
| Context.prototype.getPath = function(cur, down) { | |
| var ctx = this.stack, | |
| len = down.length, | |
| tail = cur ? undefined : this.stack.tail; | |
| if (cur && len === 0) return ctx.head; | |
| ctx = ctx.head; | |
| var i = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package glwt.dust.rebind; | |
| import java.io.PrintWriter; | |
| import java.io.Serializable; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| import com.google.gwt.core.ext.CachedGeneratorResult; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var editor = ace.edit("editor-container"); | |
| editor.setTheme("ace/theme/monokai"); | |
| if (!glwt.ace){ | |
| glwt.ace = { sessions : {} }; | |
| } | |
| var oldSession = glwt.ace.sessions["{template.name}"]; | |
| var src = "{template.source|s|j}"; | |
| if (oldSession){ | |
| editor.setSession(oldSession); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bug; | |
| import com.google.gwt.core.client.GWT; | |
| public class FormatBug { | |
| public boolean testVar; | |
| public static void testMethodString(String s) { | |
| GWT.log(s); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var vertx = require("vertx.js") | |
| var console = require('vertx/console'); | |
| console.log('module ' + JSON.stringify(module)); | |
| var dust; | |
| var x = function(){ | |
| var module = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Handler<Throwable> onError = new Handler<Throwable>(Throwable.class) { | |
| @Override | |
| public Throwable handle(Throwable value) { | |
| value.printStackTrace(); | |
| return value; | |
| } | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface Promise<T> { | |
| Promise<T> resolve(T value); | |
| Promise<T> resolve(Promise<T> promise); | |
| Promise<Throwable> reject(Throwable e); | |
| Promise<T> then(CallbackFunction onResolved); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <project name="glwt" default="jar" basedir="."> | |
| <property name="gwt.sdk" location="/home/tom/bin/gwt" /> | |
| <property name="dust.version" location="1.2.6" /> | |
| <property name="dust.path" location="/home/tom/code/javascript/dustjs" /> | |
| <property name="dust.path.src" location="${dust.path}/dist" /> | |
| <property name="dust.path.dst" location="src/glwt/dust/client/js" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Log { | |
| /* | |
| * type - is "INFO", "DEBUG", "ERROR" etc | |
| * object - is an "id" of the person calling it. as a convention, I use 'this' unless it is a static method, then I pass in the class | |
| * msg - the log message | |
| */ | |
| public static void log(String type, Object object, String msg) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ClientGetter playClientGetter = new ClientGetter() { | |
| private int playPort; | |
| private String playHost; | |
| { | |
| String portString = System.getenv("PLAY_PORT"); | |
| if (portString == null) | |
| portString = "9000"; | |
| playPort = Integer.parseInt(portString); | |
| playHost = System.getenv("PLAY_HOST"); |