Skip to content

Commit

Permalink
Accommodate org.mozilla.rhino 1.8.0 API breakage
Browse files Browse the repository at this point in the history
- Update tests expectations as well.
  • Loading branch information
merks committed Jan 14, 2025
1 parent bd4d5ea commit 54e4691
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static boolean isColumnExpression(String expression, boolean mode) {
m_compilerEnv.initFromContext(context);
Parser p = new Parser(m_compilerEnv, context.getErrorReporter());
AstRoot root = p.parse(expression, null, 0);
IRFactory ir = new IRFactory(m_compilerEnv);
IRFactory ir = new IRFactory(m_compilerEnv, "");
tree = ir.transformTree(root);
} catch (Exception e) {
getCompiledExpCacheMap(mode).put(expression, Boolean.valueOf(false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static boolean isColumnExpression(String expression, boolean mode) {
m_compilerEnv.initFromContext(context);
Parser p = new Parser(m_compilerEnv, context.getErrorReporter());
AstRoot root = p.parse(expression, null, 0);
IRFactory ir = new IRFactory(m_compilerEnv);
IRFactory ir = new IRFactory(m_compilerEnv, "");
tree = ir.transformTree(root);
} catch (Exception e) {
getCompiledExpCacheMap(mode).put(expression, Boolean.valueOf(false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static boolean isColumnExpression(String expression) {
m_compilerEnv.initFromContext(context);
Parser p = new Parser(m_compilerEnv, context.getErrorReporter());
AstRoot root = p.parse(expression, null, 0);
IRFactory ir = new IRFactory(m_compilerEnv);
IRFactory ir = new IRFactory(m_compilerEnv, "");
tree = ir.transformTree(root);
} catch (Exception e) {
compiledExprCache.put(expression, Boolean.valueOf(false));
Expand Down
2 changes: 1 addition & 1 deletion core/org.eclipse.birt.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Export-Package: org.eclipse.birt.core.archive,
org.eclipse.birt.core.template,
org.eclipse.birt.core.util
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)";visibility:=reexport,
org.mozilla.rhino;bundle-version="1.7.4";visibility:=reexport,
org.mozilla.rhino;bundle-version="1.8.0";visibility:=reexport,
com.ibm.icu;bundle-version="70.1.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
Eclipse-ExtensibleAPI: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private ScriptNode parse(String expression, Context cx) {
CompilerEnvirons compilerEnv = new CompilerEnvirons();
Parser p = new Parser(compilerEnv, cx.getErrorReporter());
AstRoot root = p.parse(expression, null, 0);
IRFactory ir = new IRFactory(compilerEnv);
IRFactory ir = new IRFactory(compilerEnv, "");
return ir.transformTree(root);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static Set<String> getReferencedMeasure(String expr) {
CompilerEnvirons ce = new CompilerEnvirons();
Parser p = new Parser(ce, cx.getErrorReporter());
AstRoot tree = p.parse(expr, null, 0);
IRFactory ir = new IRFactory(ce);
IRFactory ir = new IRFactory(ce, "");
ScriptNode script = ir.transformTree(tree);
getScriptObjectName(script, "measure", result); //$NON-NLS-1$

Expand Down Expand Up @@ -80,7 +80,7 @@ public static Set<IDimLevel> getReferencedDimLevel(String expr) throws CoreExcep
CompilerEnvirons ce = new CompilerEnvirons();
Parser p = new Parser(ce, cx.getErrorReporter());
AstRoot tree = p.parse(expr, null, 0);
IRFactory ir = new IRFactory(ce);
IRFactory ir = new IRFactory(ce, "");
ScriptNode script = ir.transformTree(tree);
populateDimLevels(null, script, result);
return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CHINA, Beijing, 7000, 14000.0
US, New York, 100, 200.0
CHINA, Shanghai, 100, 200.0
US, Chicago, 700, 1400.0
US, New York, 100, 200.0
CHINA, Shanghai, 100, 200.0
CHINA, Beijing, 400, 800.0
US, Chicago, 400, 800.0
UK, London, 600, 1200.0
UK, London, 700, 1400.0
UK, Edinburgh, 800, 1600.0
UK, Edinburgh, 1000, 2000.0
CHINA, Beijing, 7000, 14000
US, New York, 100, 200
CHINA, Shanghai, 100, 200
US, Chicago, 700, 1400
US, New York, 100, 200
CHINA, Shanghai, 100, 200
CHINA, Beijing, 400, 800
US, Chicago, 400, 800
UK, London, 600, 1200
UK, London, 700, 1400
UK, Edinburgh, 800, 1600
UK, Edinburgh, 1000, 2000
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CHINA, Beijing, 7000, 14000.0
US, New York, 100, 200.0
CHINA, Shanghai, 100, 200.0
US, Chicago, 700, 1400.0
US, New York, 100, 200.0
CHINA, Shanghai, 100, 200.0
CHINA, Beijing, 400, 800.0
US, Chicago, 400, 800.0
UK, London, 600, 1200.0
UK, London, 700, 1400.0
UK, Edinburgh, 800, 1600.0
UK, Edinburgh, 1000, 2000.0
CHINA, Beijing, 7000, 14000
US, New York, 100, 200
CHINA, Shanghai, 100, 200
US, Chicago, 700, 1400
US, New York, 100, 200
CHINA, Shanghai, 100, 200
CHINA, Beijing, 400, 800
US, Chicago, 400, 800
UK, London, 600, 1200
UK, London, 700, 1400
UK, Edinburgh, 800, 1600
UK, Edinburgh, 1000, 2000
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void testDataType() throws Exception {
result = ScriptEvalUtil.evaluateJSAsExpr(scontext, scope, script, "", 0);
result = ScriptEvalUtil.evaluateJSAsExpr(scontext, scope, script, "", 0);
result = ScriptEvalUtil.evaluateJSAsExpr(scontext, scope, script, "", 0);
assertEquals(result, new Double(1));
assertEquals(result, 1);
}

// Tests error handling
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
1.0
1
1.0 2.0
1.0 2.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.0
1
1.1
1.0 2.0
1.12.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.0
1
1.1
1.0 2.0
1.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.0
1
1.1
1.0
1.12.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.0
1
1.1
1.0
1.12.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ protected ScriptNode parse(String expression, Context cx) throws DataException {
CompilerEnvirons compilerEnv = getCompilerEnv(cx);
Parser p = new Parser(compilerEnv, cx.getErrorReporter());
AstRoot root = p.parse(expression, null, 0);
IRFactory ir = new IRFactory(compilerEnv);
IRFactory ir = new IRFactory(compilerEnv, "");
ScriptNode script = ir.transformTree(root);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static String getReferencedScriptObject(String expr, String objectName) {
CompilerEnvirons ce = new CompilerEnvirons();
Parser p = new Parser(ce, cx.getErrorReporter());
AstRoot tree = p.parse(expr, null, 0);
Node root = new IRFactory(ce).transformTree(tree);
Node root = new IRFactory(ce, "").transformTree(tree);

return getScriptObjectName(root, objectName);
} catch (Exception ex) {
Expand Down Expand Up @@ -223,7 +223,7 @@ private static Set getReferencedDimLevel(IScriptExpression expr, List bindings,
CompilerEnvirons ce = new CompilerEnvirons();
Parser p = new Parser(ce, cx.getErrorReporter());
AstRoot tree = p.parse(expr.getText(), null, 0);
Node root = new IRFactory(ce).transformTree(tree);
Node root = new IRFactory(ce, "").transformTree(tree);

populateDimLevels(null, root, result, bindings, onlyFromDirectReferenceExpr);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private static String getReferencedScriptObject(String expr, String objectName)
CompilerEnvirons ce = new CompilerEnvirons();
Parser p = new Parser(ce, cx.getErrorReporter());
AstRoot tree = p.parse(expr, null, 0);
IRFactory ir = new IRFactory(ce);
IRFactory ir = new IRFactory(ce, "");
ScriptNode script = ir.transformTree(tree);
return getScriptObjectName(script, objectName);
} finally {
Expand Down

0 comments on commit 54e4691

Please sign in to comment.