use of com.github.anba.es6draft.runtime.internal.Properties.Function in project es6draft by anba.
the class ShellFunctions method dumpObject.
/**
* shell-function: {@code dumpObject(object)}
*
* @param cx
* the execution context
* @param object
* the object to inspect
*/
@Function(name = "dumpObject", arity = 1)
public void dumpObject(ExecutionContext cx, ScriptObject object) {
PrintWriter writer = cx.getRuntimeContext().getConsole().writer();
writer.println(object.toString());
}
use of com.github.anba.es6draft.runtime.internal.Properties.Function in project es6draft by anba.
the class ShellFunctions method dumpTemplateMap.
/**
* shell-function: {@code dumpTemplateMap()}
*
* @param cx
* the execution context
*/
@Function(name = "dumpTemplateMap", arity = 0)
public void dumpTemplateMap(ExecutionContext cx) {
PrintWriter writer = cx.getRuntimeContext().getConsole().writer();
writer.println(cx.getRealm().getTemplateMap().toString());
}
use of com.github.anba.es6draft.runtime.internal.Properties.Function in project es6draft by anba.
the class V8ShellFunctions method write.
/**
* shell-function: {@code write(message)}
*
* @param cx
* the execution context
* @param messages
* the strings to write
*/
@Function(name = "write", arity = 1)
public void write(ExecutionContext cx, String... messages) {
PrintWriter writer = cx.getRuntimeContext().getConsole().writer();
writer.print(Strings.concatWith(' ', messages));
writer.flush();
}
use of com.github.anba.es6draft.runtime.internal.Properties.Function in project es6draft by anba.
the class MozShellFunctions method putstr.
/**
* shell-function: {@code putstr(message)}
*
* @param cx
* the execution context
* @param message
* the message to write
*/
@Function(name = "putstr", arity = 1)
public void putstr(ExecutionContext cx, String message) {
PrintWriter writer = cx.getRuntimeContext().getConsole().writer();
writer.print(message);
writer.flush();
}
use of com.github.anba.es6draft.runtime.internal.Properties.Function in project es6draft by anba.
the class MozShellFunctions method loadRelativeToScript.
/**
* shell-function: {@code loadRelativeToScript(filename)}
*
* @param cx
* the execution context
* @param caller
* the caller execution context
* @param fileName
* the file path
*/
@Function(name = "loadRelativeToScript", arity = 1)
public void loadRelativeToScript(ExecutionContext cx, ExecutionContext caller, String fileName) {
Path file = Paths.get(fileName);
loadScript(cx, file, relativePathToScript(cx, caller, file));
}
Aggregations