mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 10:44:47 +01:00
rename ArrayOpertion.LENGTH -> LEN for more consistency
This commit is contained in:
parent
3058348787
commit
7667c1a080
@ -1276,7 +1276,7 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
|
||||
case SET:
|
||||
opCode = ARRAY_SET;
|
||||
break;
|
||||
case LENGTH:
|
||||
case LEN:
|
||||
opCode = ARRAY_LEN;
|
||||
break;
|
||||
default:
|
||||
|
@ -643,7 +643,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
|
||||
addArrayInstruction( ArrayOperator.NEW, type, codePos, lineNumber );
|
||||
break;
|
||||
case 190: // arraylength
|
||||
addArrayInstruction( ArrayOperator.LENGTH, ValueType.i32, codePos, lineNumber );
|
||||
addArrayInstruction( ArrayOperator.LEN, ValueType.i32, codePos, lineNumber );
|
||||
break;
|
||||
case 191: // athrow
|
||||
addBlockInstruction( WasmBlockOperator.THROW, null, codePos, lineNumber );
|
||||
|
@ -82,7 +82,7 @@ class WasmArrayInstruction extends WasmInstruction {
|
||||
return type instanceof ValueType ? (ValueType)type : ValueType.anyref;
|
||||
case SET:
|
||||
return null;
|
||||
case LENGTH:
|
||||
case LEN:
|
||||
return ValueType.i32;
|
||||
default:
|
||||
throw new WasmException( "Unknown array operation: " + op, -1 );
|
||||
@ -98,7 +98,7 @@ class WasmArrayInstruction extends WasmInstruction {
|
||||
case NEW:
|
||||
case GET:
|
||||
return 2;
|
||||
case LENGTH:
|
||||
case LEN:
|
||||
return 1;
|
||||
case SET:
|
||||
return 3;
|
||||
|
@ -762,7 +762,7 @@ public class TextModuleWriter extends ModuleWriter {
|
||||
case SET:
|
||||
operation = "set";
|
||||
break;
|
||||
case LENGTH:
|
||||
case LEN:
|
||||
operation = "len";
|
||||
break;
|
||||
default:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2018 Volker Berlin (i-net software)
|
||||
Copyright 2018 - 2019 Volker Berlin (i-net software)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -25,5 +25,5 @@ public enum ArrayOperator {
|
||||
NEW,
|
||||
GET,
|
||||
SET,
|
||||
LENGTH,
|
||||
LEN,
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user