C# Class Jurassic.Compiler.EmitConversion

Outputs IL that converts between types.
显示文件 Open project: paulbartrum/jurassic Class Usage Examples

Public Methods

Method Description
Convert ( ILGenerator generator, PrimitiveType fromType, PrimitiveType toType ) : void

Pops the value on the stack, converts it to the given type, then pushes the result onto the stack.

Convert ( ILGenerator generator, PrimitiveType fromType, PrimitiveType toType, OptimizationInfo optimizationInfo ) : void

Pops the value on the stack, converts it to the given type, then pushes the result onto the stack.

Convert ( ILGenerator generator, PrimitiveType fromType, PrimitiveType toType, string path, string function, int line ) : void

Pops the value on the stack, converts it to the given type, then pushes the result onto the stack.

ToAny ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to an object, then pushes the result onto the stack.

ToBool ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to a boolean, then pushes the boolean result onto the stack.

ToConcatenatedString ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to a concatenated string, then pushes the result onto the stack.

ToInt32 ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to an integer, then pushes the integer result onto the stack. Large numbers wrap (i.e. 4294967296 -> 0).

ToInteger ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to an integer, then pushes the integer result onto the stack.

ToNumber ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to a double, then pushes the double result onto the stack.

ToObject ( ILGenerator generator, PrimitiveType fromType, OptimizationInfo optimizationInfo ) : void

Pops the value on the stack, converts it to a javascript object, then pushes the result onto the stack.

ToObject ( ILGenerator generator, PrimitiveType fromType, string path, string function, int line ) : void

Pops the value on the stack, converts it to a javascript object, then pushes the result onto the stack.

ToPrimitive ( ILGenerator generator, PrimitiveType fromType, PrimitiveTypeHint preferredType ) : void

Pops the value on the stack, converts it to a primitive value, then pushes the result onto the stack.

ToPropertyKey ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to a property key (either a symbol or a string), then pushes the result onto the stack.

ToString ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to a string, then pushes the result onto the stack.

ToUInt32 ( ILGenerator generator, PrimitiveType fromType ) : void

Pops the value on the stack, converts it to an unsigned integer, then pushes the integer result onto the stack. Large numbers wrap (i.e. 4294967296 -> 0).

Method Details

Convert() public static method

Pops the value on the stack, converts it to the given type, then pushes the result onto the stack.
public static Convert ( ILGenerator generator, PrimitiveType fromType, PrimitiveType toType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
toType PrimitiveType The type to convert to.
return void

Convert() public static method

Pops the value on the stack, converts it to the given type, then pushes the result onto the stack.
public static Convert ( ILGenerator generator, PrimitiveType fromType, PrimitiveType toType, OptimizationInfo optimizationInfo ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
toType PrimitiveType The type to convert to.
optimizationInfo OptimizationInfo Information about the line number, function and path.
return void

Convert() public static method

Pops the value on the stack, converts it to the given type, then pushes the result onto the stack.
public static Convert ( ILGenerator generator, PrimitiveType fromType, PrimitiveType toType, string path, string function, int line ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
toType PrimitiveType The type to convert to.
path string The path of the javascript source file that is currently executing.
function string The name of the currently executing function.
line int The line number of the statement that is currently executing.
return void

ToAny() public static method

Pops the value on the stack, converts it to an object, then pushes the result onto the stack.
public static ToAny ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToBool() public static method

Pops the value on the stack, converts it to a boolean, then pushes the boolean result onto the stack.
public static ToBool ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToConcatenatedString() public static method

Pops the value on the stack, converts it to a concatenated string, then pushes the result onto the stack.
public static ToConcatenatedString ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToInt32() public static method

Pops the value on the stack, converts it to an integer, then pushes the integer result onto the stack. Large numbers wrap (i.e. 4294967296 -> 0).
public static ToInt32 ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToInteger() public static method

Pops the value on the stack, converts it to an integer, then pushes the integer result onto the stack.
public static ToInteger ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToNumber() public static method

Pops the value on the stack, converts it to a double, then pushes the double result onto the stack.
public static ToNumber ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToObject() public static method

Pops the value on the stack, converts it to a javascript object, then pushes the result onto the stack.
public static ToObject ( ILGenerator generator, PrimitiveType fromType, OptimizationInfo optimizationInfo ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
optimizationInfo OptimizationInfo Information about the line number, function and path.
return void

ToObject() public static method

Pops the value on the stack, converts it to a javascript object, then pushes the result onto the stack.
public static ToObject ( ILGenerator generator, PrimitiveType fromType, string path, string function, int line ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
path string The path of the javascript source file that is currently executing.
function string The name of the currently executing function.
line int The line number of the statement that is currently executing.
return void

ToPrimitive() public static method

Pops the value on the stack, converts it to a primitive value, then pushes the result onto the stack.
public static ToPrimitive ( ILGenerator generator, PrimitiveType fromType, PrimitiveTypeHint preferredType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
preferredType PrimitiveTypeHint Specifies whether toString() or valueOf() should be /// preferred when converting to a primitive.
return void

ToPropertyKey() public static method

Pops the value on the stack, converts it to a property key (either a symbol or a string), then pushes the result onto the stack.
public static ToPropertyKey ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToString() public static method

Pops the value on the stack, converts it to a string, then pushes the result onto the stack.
public static ToString ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void

ToUInt32() public static method

Pops the value on the stack, converts it to an unsigned integer, then pushes the integer result onto the stack. Large numbers wrap (i.e. 4294967296 -> 0).
public static ToUInt32 ( ILGenerator generator, PrimitiveType fromType ) : void
generator ILGenerator The IL generator.
fromType PrimitiveType The type to convert from.
return void