43 lines
1.4 KiB
Java
43 lines
1.4 KiB
Java
/******************************************************************************
|
|
* Copyright (c) 2002 - 2006 IBM Corporation.
|
|
* All rights reserved. This program and the accompanying materials
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
* which accompanies this distribution, and is available at
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
*
|
|
* Contributors:
|
|
* IBM Corporation - initial API and implementation
|
|
*****************************************************************************/
|
|
package com.ibm.wala.cast.js.ssa;
|
|
|
|
import com.ibm.wala.ssa.SSAAbstractUnaryInstruction;
|
|
import com.ibm.wala.ssa.SSAInstruction;
|
|
import com.ibm.wala.ssa.SymbolTable;
|
|
import com.ibm.wala.ssa.ValueDecorator;
|
|
|
|
import java.util.Collection;
|
|
|
|
public class JavaScriptTypeOfInstruction extends SSAAbstractUnaryInstruction {
|
|
|
|
public JavaScriptTypeOfInstruction(int lval, int object) {
|
|
super(lval, object);
|
|
}
|
|
|
|
public SSAInstruction copyForSSA(int[] defs, int[] uses) {
|
|
return new JavaScriptTypeOfInstruction((defs != null ? defs[0] : getDef(0)), (uses != null ? uses[0] : getUse(0)));
|
|
}
|
|
|
|
public String toString(SymbolTable symbolTable, ValueDecorator d) {
|
|
return getValueString(symbolTable, d, getDef(0)) + " = typeof(" + getValueString(symbolTable, d, getUse(0)) + ")";
|
|
}
|
|
|
|
public void visit(IVisitor v) {
|
|
((InstructionVisitor) v).visitTypeOf(this);
|
|
}
|
|
|
|
public Collection getExceptionTypes() {
|
|
return Util.noExceptions();
|
|
}
|
|
|
|
}
|