Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bugzilla#351482, 462696: upgrade org.mozilla.javascript to 1.7.5. Change
corresponding API usage and build script.
  • Loading branch information
Yulin Wang committed May 6, 2015
1 parent 18fd4f8 commit 87eaf0d
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 53 deletions.
Expand Up @@ -18,8 +18,8 @@
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
* The utility class of expression, if the expression is column, return true,
Expand Down Expand Up @@ -75,7 +75,7 @@ public static boolean isColumnExpression( String expression, boolean mode )
return ( (Boolean) getCompiledExpCacheMap( mode ).get( expression ) ).booleanValue( );
}
Context context = Context.enter( );
ScriptOrFnNode tree;
AstRoot tree;
try
{
CompilerEnvirons m_compilerEnv = new CompilerEnvirons( );
Expand Down
Expand Up @@ -18,8 +18,8 @@
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
* The utility class of expression, if the expression is column, return true,
Expand Down Expand Up @@ -75,7 +75,7 @@ public static boolean isColumnExpression( String expression, boolean mode )
return ( (Boolean) getCompiledExpCacheMap( mode ).get( expression ) ).booleanValue( );
}
Context context = Context.enter( );
ScriptOrFnNode tree;
AstRoot tree;
try
{
CompilerEnvirons m_compilerEnv = new CompilerEnvirons( );
Expand Down
Expand Up @@ -32,8 +32,8 @@
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
* The utility class of expression, if the expression is column, return true,
Expand Down Expand Up @@ -77,7 +77,7 @@ public static boolean isColumnExpression( String expression )
if ( compiledExprCache.containsKey( expression ) )
return ( (Boolean) compiledExprCache.get( expression ) ).booleanValue( );
Context context = Context.enter( );
ScriptOrFnNode tree;
AstRoot tree;
try
{
CompilerEnvirons m_compilerEnv = new CompilerEnvirons( );
Expand Down
2 changes: 1 addition & 1 deletion core/org.eclipse.birt.core/META-INF/MANIFEST.MF
Expand Up @@ -27,7 +27,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.javascript;bundle-version="[1.7.2,1.7.3)";visibility:=reexport
org.mozilla.javascript;bundle-version="1.7.4";visibility:=reexport
Eclipse-LazyStart: true
Eclipse-ExtensibleAPI: true
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Expand Down
Expand Up @@ -19,11 +19,11 @@
import org.eclipse.birt.core.i18n.ResourceConstants;
import org.mozilla.javascript.CompilerEnvirons;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.FunctionNode;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;
import org.mozilla.javascript.ast.FunctionNode;

/**
* This utility class is to compile expression to get a list of column
Expand Down Expand Up @@ -74,7 +74,7 @@ public static List compileColumnExpression( ExpressionParserUtility util, Strin
Context context = Context.enter( );
try
{
ScriptOrFnNode tree = util.parse( expression, context );
AstRoot tree = util.parse( expression, context );
util.CompiledExprFromTree( expression,
context,
tree,
Expand Down Expand Up @@ -136,7 +136,7 @@ public static boolean isDirectColumnRef( String expression, String indicator )
* @throws BirtException
*/
private void CompiledExprFromTree( String expression, Context context,
ScriptOrFnNode tree, List columnExprList ) throws BirtException
AstRoot tree, List columnExprList ) throws BirtException
{
if ( tree.getFirstChild( ) == tree.getLastChild( ) )
{
Expand Down Expand Up @@ -177,7 +177,7 @@ private void CompiledExprFromTree( String expression, Context context,
* @param cx
* @return
*/
private ScriptOrFnNode parse( String expression, Context cx )
private AstRoot parse( String expression, Context cx )
{
CompilerEnvirons compilerEnv = new CompilerEnvirons( );
Parser p = new Parser( compilerEnv, cx.getErrorReporter( ) );
Expand All @@ -193,7 +193,7 @@ private ScriptOrFnNode parse( String expression, Context cx )
* @param columnExprList
* @throws BirtException
*/
private void processChild( Node child, ScriptOrFnNode tree,
private void processChild( Node child, AstRoot tree,
List columnExprList ) throws BirtException
{
switch ( child.getType( ) )
Expand Down Expand Up @@ -228,7 +228,7 @@ private void processChild( Node child, ScriptOrFnNode tree,
* @param refNode
* @throws BirtException
*/
private void compileDirectColRefExpr( Node refNode, ScriptOrFnNode tree,
private void compileDirectColRefExpr( Node refNode, AstRoot tree,
List columnExprList ) throws BirtException
{
assert ( refNode.getType( ) == Token.GETPROP
Expand Down Expand Up @@ -262,7 +262,7 @@ private void compileDirectColRefExpr( Node refNode, ScriptOrFnNode tree,
* @param columnExprList
* @throws BirtException
*/
private void compileOuterColRef( Node refNode, ScriptOrFnNode tree,
private void compileOuterColRef( Node refNode, AstRoot tree,
List columnExprList ) throws BirtException
{
int level = compileOuterColRefExpr( refNode );
Expand Down Expand Up @@ -291,7 +291,7 @@ private void compileOuterColRef( Node refNode, ScriptOrFnNode tree,
* @param columnExprList
* @throws BirtException
*/
private void compileRowPositionRef( Node refNode, ScriptOrFnNode tree,
private void compileRowPositionRef( Node refNode, AstRoot tree,
List columnExprList ) throws BirtException
{
Node rowFirstNode = refNode.getFirstChild( );
Expand Down Expand Up @@ -329,7 +329,7 @@ private void compileRowPositionRef( Node refNode, ScriptOrFnNode tree,
* @param columnExprList
* @throws BirtException
*/
private void compileSimpleColumnRefExpr( Node refNode, ScriptOrFnNode tree,
private void compileSimpleColumnRefExpr( Node refNode, AstRoot tree,
List columnExprList ) throws BirtException
{
Node rowName = refNode.getFirstChild( );
Expand Down Expand Up @@ -466,7 +466,7 @@ else if ( rowFirstNode.getType( ) == Token.GETPROP
* @throws BirtException
*/
private void compileAggregateExpr( Node callNode,
ScriptOrFnNode tree, List columnExprList ) throws BirtException
AstRoot tree, List columnExprList ) throws BirtException
{
assert ( callNode.getType( ) == Token.CALL );
compileAggregationFunction( callNode, tree, columnExprList );
Expand All @@ -481,7 +481,7 @@ private void compileAggregateExpr( Node callNode,
* @throws BirtException
*/
private void compileAggregationFunction( Node callNode,
ScriptOrFnNode tree, List columnExprList ) throws BirtException
AstRoot tree, List columnExprList ) throws BirtException
{
Node firstChild = callNode.getFirstChild( );
if ( firstChild.getType( ) != Token.GETPROP )
Expand All @@ -502,7 +502,7 @@ private void compileAggregationFunction( Node callNode,
* @param callNode
* @throws BirtException
*/
private void extractArguments( Node callNode, ScriptOrFnNode tree,
private void extractArguments( Node callNode, AstRoot tree,
List columnExprList ) throws BirtException
{
Node arg = callNode.getFirstChild( ).getNext( );
Expand All @@ -524,7 +524,7 @@ private void extractArguments( Node callNode, ScriptOrFnNode tree,
* @param complexNode
* @throws BirtException
*/
private void compileComplexExpr( Node complexNode, ScriptOrFnNode tree,
private void compileComplexExpr( Node complexNode, AstRoot tree,
List columnExprList ) throws BirtException
{
Node child = complexNode.getFirstChild( );
Expand Down Expand Up @@ -567,7 +567,7 @@ private void compileComplexExpr( Node complexNode, ScriptOrFnNode tree,
* @param columnExprList
* @throws BirtException
*/
private void compileFunctionNode( FunctionNode node, ScriptOrFnNode tree,
private void compileFunctionNode( FunctionNode node, AstRoot tree,
List columnExprList ) throws BirtException
{
compileComplexExpr( node, tree, columnExprList );
Expand All @@ -580,7 +580,7 @@ private void compileFunctionNode( FunctionNode node, ScriptOrFnNode tree,
* @param tree
* @return
*/
private int getFunctionIndex( String functionName, ScriptOrFnNode tree )
private int getFunctionIndex( String functionName, AstRoot tree )
{
int index = -1;
for ( int i = 0; i < tree.getFunctionCount( ); i++ )
Expand Down
Expand Up @@ -21,8 +21,8 @@
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
*
Expand All @@ -46,7 +46,7 @@ public static Set<String> getReferencedMeasure( String expr )
Context cx = Context.enter( );
CompilerEnvirons ce = new CompilerEnvirons( );
Parser p = new Parser( ce, cx.getErrorReporter( ) );
ScriptOrFnNode tree = p.parse( expr, null, 0 );
AstRoot tree = p.parse( expr, null, 0 );

getScriptObjectName( tree, "measure", result );

Expand Down Expand Up @@ -81,7 +81,7 @@ public static Set<IDimLevel> getReferencedDimLevel( String expr )
Context cx = Context.enter( );
CompilerEnvirons ce = new CompilerEnvirons( );
Parser p = new Parser( ce, cx.getErrorReporter( ) );
ScriptOrFnNode tree = p.parse( expr, null, 0 );
AstRoot tree = p.parse( expr, null, 0 );

populateDimLevels( null,
tree,
Expand Down
Expand Up @@ -31,8 +31,8 @@
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.Script;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
* This class provides default implementations for the compilation of ROM
Expand Down Expand Up @@ -97,7 +97,7 @@ protected CompiledExpression compileExpression( IScriptExpression baseExpr, Scri
return null;
IDataScriptEngine engine = (IDataScriptEngine) context.getScriptEngine( IDataScriptEngine.ENGINE_NAME );

ScriptOrFnNode tree = parse( exp, engine.getJSContext( context ) );
AstRoot tree = parse( exp, engine.getJSContext( context ) );
return processScriptTree( exp, tree, engine.getJSContext( context ));
}
catch ( Exception e )
Expand Down Expand Up @@ -129,7 +129,7 @@ protected CompiledExpression compileExpression( String expression,

IDataScriptEngine engine = (IDataScriptEngine) context.getScriptEngine( IDataScriptEngine.ENGINE_NAME );

ScriptOrFnNode tree = parse( exp, engine.getJSContext( context ) );
AstRoot tree = parse( exp, engine.getJSContext( context ) );
return processScriptTree( exp, tree, engine.getJSContext( context ) );
}
catch ( Exception e )
Expand Down Expand Up @@ -176,7 +176,7 @@ private CompilerEnvirons getCompilerEnv( Context context )
* DataException
*/
private CompiledExpression processScriptTree( String expression,
ScriptOrFnNode tree, Context context ) throws DataException
AstRoot tree, Context context ) throws DataException

{
CompiledExpression expr;
Expand Down Expand Up @@ -227,7 +227,7 @@ private CompiledExpression processScriptTree( String expression,
* @return
* @throws DataException
*/
protected ScriptOrFnNode parse( String expression, Context cx )
protected AstRoot parse( String expression, Context cx )
throws DataException
{
if ( expression == null )
Expand Down Expand Up @@ -454,7 +454,7 @@ protected ComplexExpression compileComplexExpr( Context context, Node complexNod
* @param tree
* @param expr
*/
protected void compileForBytecodeExpr( Context context, ScriptOrFnNode tree,
protected void compileForBytecodeExpr( Context context, AstRoot tree,
CompiledExpression expr )
{
assert ( expr instanceof BytecodeExpression );
Expand Down
Expand Up @@ -19,8 +19,8 @@
import org.eclipse.birt.data.engine.script.ScriptConstants;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
*
Expand Down Expand Up @@ -116,7 +116,7 @@ private void extractArguments( Context context,
continue;
}

ScriptOrFnNode tree = new ScriptOrFnNode( Token.SCRIPT );
AstRoot tree = new AstRoot( Token.SCRIPT );
Node exprNode = new Node( Token.EXPR_RESULT);
exprNode.addChildToFront( arg );
tree.addChildrenToFront( exprNode );
Expand Down
Expand Up @@ -30,9 +30,9 @@
import org.eclipse.birt.data.engine.script.ScriptConstants;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
* This class handles the compilation of ROM JavaScript expressions of the
Expand Down Expand Up @@ -189,7 +189,7 @@ protected CompiledExpression compileDirectColRefExpr( Node parent, Node refNode,
{
IScriptExpression expression = (IScriptExpression) binding.getExpression( );
currentGroupLevelList.add( expression.getGroupName( ) );
ScriptOrFnNode tree = parse( expression.getText( ),
AstRoot tree = parse( expression.getText( ),
context );
if ( tree.getFirstChild( ) != null
&& tree.getFirstChild( ).getFirstChild( ) != null
Expand Down Expand Up @@ -563,7 +563,7 @@ private void extractArguments( Context context,
continue;
}

ScriptOrFnNode tree = new ScriptOrFnNode( Token.SCRIPT );
AstRoot tree = new AstRoot( Token.SCRIPT );
Node exprNode = new Node( Token.EXPR_RESULT );
exprNode.addChildToFront( arg );
tree.addChildrenToFront( exprNode );
Expand Down
Expand Up @@ -38,8 +38,8 @@
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
*
Expand Down Expand Up @@ -142,7 +142,7 @@ public static String getReferencedScriptObject( String expr,
Context cx = Context.enter( );
CompilerEnvirons ce = new CompilerEnvirons( );
Parser p = new Parser( ce, cx.getErrorReporter( ) );
ScriptOrFnNode tree = p.parse( expr, null, 0 );
AstRoot tree = p.parse( expr, null, 0 );

return getScriptObjectName( tree, objectName );
}
Expand Down Expand Up @@ -247,7 +247,7 @@ private static Set getReferencedDimLevel( IScriptExpression expr,
Context cx = Context.enter( );
CompilerEnvirons ce = new CompilerEnvirons( );
Parser p = new Parser( ce, cx.getErrorReporter( ) );
ScriptOrFnNode tree = p.parse( expr.getText( ), null, 0 );
AstRoot tree = p.parse( expr.getText( ), null, 0 );

populateDimLevels( null,
tree,
Expand Down
Expand Up @@ -26,8 +26,8 @@
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Parser;
import org.mozilla.javascript.ScriptOrFnNode;
import org.mozilla.javascript.Token;
import org.mozilla.javascript.ast.AstRoot;

/**
*
Expand Down Expand Up @@ -374,7 +374,7 @@ private static String getReferencedScriptObject( String expr,
Context cx = Context.enter( );
CompilerEnvirons ce = new CompilerEnvirons( );
Parser p = new Parser( ce, cx.getErrorReporter( ) );
ScriptOrFnNode tree = p.parse( expr, null, 0 );
AstRoot tree = p.parse( expr, null, 0 );

return getScriptObjectName( tree, objectName );
}
Expand Down
Expand Up @@ -10,7 +10,7 @@ Bundle-Vendor: Eclipse BIRT Project
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,5.0.0)",
org.eclipse.datatools.connectivity.oda;bundle-version="[3.2.0,4.0.0)",
org.junit;bundle-version="[3.8.1,4.0.0)";resolution:=optional,
org.junit;bundle-version="3.8.1";resolution:=optional,
org.apache.derby.core;bundle-version="[10.1.2,11.0.0)";resolution:=optional,
org.eclipse.datatools.connectivity.oda.profile;bundle-version="[3.0.7,4.0.0)";resolution:=optional,
org.eclipse.birt.report.data.bidi.utils;bundle-version="[2.5.1,5.0.0)",
Expand Down

0 comments on commit 87eaf0d

Please sign in to comment.