Created
October 1, 2012 05:36
-
-
Save sideshowbarker/3809647 to your computer and use it in GitHub Desktop.
This file contains 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
diff -r ed90a83ab0fd relaxng/datatype/java/src/org/whattf/datatype/Pattern.java | |
--- a/relaxng/datatype/java/src/org/whattf/datatype/Pattern.java Sat Apr 21 17:35:50 2012 +0900 | |
+++ b/relaxng/datatype/java/src/org/whattf/datatype/Pattern.java Mon Oct 01 14:35:28 2012 +0900 | |
@@ -22,6 +22,7 @@ | |
package org.whattf.datatype; | |
+import org.mozilla.javascript.ContextFactory; | |
import org.mozilla.javascript.EcmaError; | |
import org.mozilla.javascript.regexp.RegExpImpl; | |
import org.relaxng.datatype.DatatypeException; | |
@@ -58,9 +59,10 @@ | |
throws DatatypeException { | |
// TODO find out what kind of thread concurrency guarantees are made | |
RegExpImpl rei = new RegExpImpl(); | |
+ ContextFactory cf = new ContextFactory(); | |
String anchoredRegex = "^(?:" + literal + ")$"; | |
try { | |
- rei.compileRegExp(null, anchoredRegex, ""); | |
+ rei.compileRegExp(cf.enterContext(), anchoredRegex, ""); | |
} catch (EcmaError ee) { | |
throw newDatatypeException(ee.getErrorMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment