未验证 提交 8a9012c3 编写于 作者: O openharmony_ci 提交者: Gitee

!18427 Modifying BigInt type data in buffer that cannot be compiled in ets to 3.2Release

Merge pull request !18427 from bihu/cherry-pick-1684480436
...@@ -872,7 +872,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, ...@@ -872,7 +872,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigInt64BE(0).toString()); console.log(buf.readBigInt64BE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8); let buf1 = buffer.allocUninitializedFromPool(8);
let result = buf1.writeBigInt64BE(0x0102030405060708n, 0); let result = buf1.writeBigInt64BE(BigInt(0x0102030405060708), 0);
``` ```
### readBigInt64LE ### readBigInt64LE
...@@ -913,7 +913,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, ...@@ -913,7 +913,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigInt64LE(0).toString()); console.log(buf.readBigInt64LE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8); let buf1 = buffer.allocUninitializedFromPool(8);
let result = buf1.writeBigInt64BE(0x0102030405060708n, 0); let result = buf1.writeBigInt64BE(BigInt(0x0102030405060708), 0);
``` ```
### readBigUInt64BE ### readBigUInt64BE
...@@ -954,7 +954,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, ...@@ -954,7 +954,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigUInt64BE(0).toString()); console.log(buf.readBigUInt64BE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8); let buf1 = buffer.allocUninitializedFromPool(8);
let result = buf1.writeBigUInt64BE(0xdecafafecacefaden, 0); let result = buf1.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0);
``` ```
### readBigUInt64LE ### readBigUInt64LE
...@@ -995,7 +995,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, ...@@ -995,7 +995,7 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70,
console.log(buf.readBigUInt64LE(0).toString()); console.log(buf.readBigUInt64LE(0).toString());
let buf1 = buffer.allocUninitializedFromPool(8); let buf1 = buffer.allocUninitializedFromPool(8);
let result = buf1.writeBigUInt64BE(0xdecafafecacefaden, 0); let result = buf1.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0);
``` ```
### readDoubleBE ### readDoubleBE
...@@ -2045,7 +2045,7 @@ writeBigInt64BE(value: bigint, offset?: number): number ...@@ -2045,7 +2045,7 @@ writeBigInt64BE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer'; import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8); let buf = buffer.allocUninitializedFromPool(8);
let result = buf.writeBigInt64BE(0x0102030405060708n, 0); let result = buf.writeBigInt64BE(BigInt(0x0102030405060708), 0);
``` ```
### writeBigInt64LE ### writeBigInt64LE
...@@ -2084,7 +2084,7 @@ writeBigInt64LE(value: bigint, offset?: number): number ...@@ -2084,7 +2084,7 @@ writeBigInt64LE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer'; import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8); let buf = buffer.allocUninitializedFromPool(8);
let result = buf.writeBigInt64LE(0x0102030405060708n, 0); let result = buf.writeBigInt64LE(BigInt(0x0102030405060708), 0);
``` ```
### writeBigUInt64BE ### writeBigUInt64BE
...@@ -2123,7 +2123,7 @@ writeBigUInt64BE(value: bigint, offset?: number): number ...@@ -2123,7 +2123,7 @@ writeBigUInt64BE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer'; import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8); let buf = buffer.allocUninitializedFromPool(8);
let result = buf.writeBigUInt64BE(0xdecafafecacefaden, 0); let result = buf.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0);
``` ```
### writeBigUInt64LE ### writeBigUInt64LE
...@@ -2162,7 +2162,7 @@ writeBigUInt64LE(value: bigint, offset?: number): number ...@@ -2162,7 +2162,7 @@ writeBigUInt64LE(value: bigint, offset?: number): number
import buffer from '@ohos.buffer'; import buffer from '@ohos.buffer';
let buf = buffer.allocUninitializedFromPool(8); let buf = buffer.allocUninitializedFromPool(8);
let result = buf.writeBigUInt64LE(0xdecafafecacefaden, 0); let result = buf.writeBigUInt64LE(BigInt(0xdecafafecacefade), 0);
``` ```
### writeDoubleBE ### writeDoubleBE
......
...@@ -1646,18 +1646,18 @@ compareTo(other: ScopeComparable): boolean; ...@@ -1646,18 +1646,18 @@ compareTo(other: ScopeComparable): boolean;
```js ```js
class Temperature{ class Temperature{
constructor(value){ // 当使用ArkTS语言开发时,需要补充以下代码:
// 当使用ts语言开发时,需要补充以下代码: // private readonly _temp: Temperature;
// private readonly _temp: Temperature; constructor(value) {
this._temp = value; this._temp = value;
} }
compareTo(value){ compareTo(value) {
return this._temp >= value.getTemp(); return this._temp >= value.getTemp();
} }
getTemp(){ getTemp() {
return this._temp; return this._temp;
} }
toString(){ toString() {
return this._temp.toString(); return this._temp.toString();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册