提交 285902e1 编写于 作者: B bi-hu 提交者: bihu

fixed bd40a944 from https://gitee.com/bi-hu-01/docs/pulls/18386

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