Skip to content

Instantly share code, notes, and snippets.

View hns's full-sized avatar

Hannes Wallnoefer hns

View GitHub Profile
diff -r 524852d0cc0d src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java Mon Mar 16 18:13:38 2015 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java Wed Mar 18 22:40:47 2015 +0100
@@ -405,6 +405,7 @@
int endp;
isNull = 1;
while (k < stk) {
+ e = stack[k++];
if (e.type == MEM_START) {
if (e.getMemEnd() == INVALID_INDEX) {
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@hns
hns / less-nashorn-1.3.3.js
Created July 18, 2013 13:18
Two modified versions of less-rhino-1.3.3.js to run a benchmark with Nashorn and Rhino.
//
// Stub out `require` in rhino
//
function require(arg) {
return less[arg.split('/')[1]];
};
// ecma-5.js
//
// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
hannes@t61:~/git/rhino$ java -jar build/rhino1_7R5pre/js.jar -opt 0 -f build/tests/shell.js build/tests/js1_5/Regress/regress-111557.js
Exception in thread "main" java.lang.NullPointerException
at org.mozilla.javascript.CodeGenerator.addGoto(CodeGenerator.java:1167)
at org.mozilla.javascript.CodeGenerator.visitStatement(CodeGenerator.java:346)
at org.mozilla.javascript.CodeGenerator.visitStatement(CodeGenerator.java:276)
at org.mozilla.javascript.CodeGenerator.visitStatement(CodeGenerator.java:276)
at org.mozilla.javascript.CodeGenerator.generateICodeFromTree(CodeGenerator.java:113)
at org.mozilla.javascript.CodeGenerator.compile(CodeGenerator.java:83)
at org.mozilla.javascript.Interpreter.compile(Interpreter.java:194)
at org.mozilla.javascript.Context.compileImpl(Context.java:2397)
@hns
hns / gist:2988852
Created June 25, 2012 14:06
How to upload a Rhino snapshot release
mvn deploy:deploy-file -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=sonatype-nexus-snapshots -DpomFile=pom.xml -Dfile=js.jar
@hns
hns / JsActivity.js
Created February 22, 2012 20:53
Native Android activity written in JavaScript
var {TextView} = Packages.android.widget;
function onCreate(savedState) {
this.super$onCreate(savedState);
var view = new TextView(this);
view.text = "Android ♥ Rhino";
this.contentView = view;
}
var {WorkerPromise} = require("ringo/worker");
exports.app = function(request) {
return new WorkerPromise(module.id, "Hello World");
}
function onmessage(e) {
e.source.postMessage({status: 200, headers: {}, body: [e.data]});
}
Java Exception: java.lang.NullPointerException
at java.util.Collections.addAll(Collections.java:3836)
at sun.security.ssl.AbstractTrustManagerWrapper.<init>(SSLContextImpl.java:778)
at sun.security.ssl.SSLContextImpl.chooseTrustManager(SSLContextImpl.java:133)
at sun.security.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:89)
at javax.net.ssl.SSLContext.init(SSLContext.java:283)
at org.eclipse.jetty.http.ssl.SslContextFactory.doStart(SslContextFactory.java:217)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.client.HttpClient.doStart(HttpClient.java:438)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
private static boolean assignType(int[] varTypes, int index, int type)
{
int prev = varTypes[index];
return prev != (varTypes[index] |= type);
}