提交 ca0d73b6 编写于 作者: Z zWX1234017

更改XmlPullParser接口的入参错误用法,url,util接口可选入参的资料修改

Signed-off-by: NzWX1234017 <zhaoduwei3@huawei.com>
上级 4d2fd214
......@@ -23,7 +23,7 @@ URLParams的构造函数。
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| init | string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams | 否 | 入参对象。<br/>- string[][]:字符串二维数组<br/>- Record&lt;string, string&gt;:对象列表<br/>- string:字符串<br/>- URLSearchParams:对象 |
| init | string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams | 否 | 入参对象。<br/>- string[][]:字符串二维数组<br/>- Record&lt;string, string&gt;:对象列表<br/>- string:字符串<br/>- URLSearchParams:对象<br/>- 默认值:null。 |
**示例:**
......@@ -150,7 +150,7 @@ forEach(callbackFn: (value: string, key: string, searchParams: this) => void, th
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callbackFn | function | 是 | 回调函数。 |
| thisArg | Object | 否 | callbackFn被调用时用作this值 |
| thisArg | Object | 否 | callbackFn被调用时用作this值,默认值是本对象。 |
**表1** callbackFn的参数说明
......@@ -404,7 +404,7 @@ URL的构造函数。
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| url | string | 是 | 入参对象。 |
| base | string \| URL | 否 | 入参字符串或者对象。<br/>- string:字符串<br/>- URL:字符串或对象 |
| base | string \| URL | 否 | 入参字符串或者对象。<br/>- string:字符串<br/>- URL:字符串或对象<br/>- 默认值是空字符串或空对象。 |
**示例:**
......@@ -444,7 +444,7 @@ URL静态成员函数。
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| url | string | 是 | 入参对象。 |
| base | string \| URL | 否 | 入参字符串或者对象。<br/>- string:字符串<br/>- URL:字符串或对象 |
| base | string \| URL | 否 | 入参字符串或者对象。<br/>- string:字符串<br/>- URL:字符串或对象<br/>- 默认值是空字符串或空对象。 |
**错误码:**
......@@ -522,7 +522,7 @@ URLSearchParams的构造函数。
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| init | string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams | 否 | 入参对象。<br/>- string[][]:字符串二维数组<br/>- Record&lt;string, string&gt;:对象列表<br/>- string:字符串<br/>- URLSearchParams:对象 |
| init | string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams | 否 | 入参对象。<br/>- string[][]:字符串二维数组<br/>- Record&lt;string, string&gt;:对象列表<br/>- string:字符串<br/>- URLSearchParams:对象<br/>- 默认值:null。 |
**示例:**
......@@ -665,7 +665,7 @@ forEach(callbackFn: (value: string, key: string, searchParams: this) => void, th
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callbackFn | function | 是 | 回调函数。 |
| thisArg | Object | 否 | callbackFn被调用时用作this值 |
| thisArg | Object | 否 | callbackFn被调用时用作this值,默认值是本对象。 |
**表1** callbackFn的参数说明
......
......@@ -547,7 +547,7 @@ TextEncoder的构造函数。
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ---- | ---- | ---- |
| encoding | string | 否 | 编码格式 |
| encoding | string | 否 | 编码格式,默认值为'utf-8'。 |
**示例:**
......@@ -567,7 +567,7 @@ encodeInto(input?: string): Uint8Array
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------------------ |
| input | string | 否 | 需要编码的字符串。 |
| input | string | 否 | 需要编码的字符串,默认值是空字符串。 |
**返回值:**
......@@ -665,7 +665,7 @@ encode(input?: string): Uint8Array
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| input | string | 否 | 需要编码的字符串。 |
| input | string | 否 | 需要编码的字符串,默认值是空字符串。 |
**返回值:**
......
......@@ -32,7 +32,7 @@ XmlSerializer的构造函数。
```js
let arrayBuffer = new ArrayBuffer(2048);
let thatSer = new xml.XmlSerializer(arrayBuffer,"utf-8");
let thatSer = new xml.XmlSerializer(arrayBuffer, "utf-8");
thatSer.setDeclaration();
let result = '<?xml version="1.0" encoding="utf-8"?>';
let view = new Uint8Array(arrayBuffer);
......@@ -400,13 +400,9 @@ let strXml =
' </h:tr>' +
' </h:table>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let i = 0; i < strLen; ++i) {
bufView[i] = strXml.charCodeAt(i);
}
let that = new xml.XmlPullParser(arrayBuffer, 'UTF-8');
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer, 'UTF-8');
let str1 = '';
function func1(name, value){
str1 += name+':'+value;
......@@ -442,13 +438,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -513,13 +505,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -560,13 +548,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -610,13 +594,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -657,13 +637,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -703,13 +679,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -749,13 +721,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -796,13 +764,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -842,13 +806,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -888,13 +848,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......@@ -933,13 +889,9 @@ let strXml =
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
let arrayBuffer = new ArrayBuffer(strXml.length);
let bufView = new Uint8Array(arrayBuffer);
let strLen = strXml.length;
for (let tmp = 0; tmp < strLen; ++tmp) {
bufView[tmp] = strXml.charCodeAt(tmp);
}
let that = new xml.XmlPullParser(arrayBuffer);
let textEncoder = new util.TextEncoder();
let arrbuffer = textEncoder.encodeInto(strXml);
let that = new xml.XmlPullParser(arrbuffer.buffer);
let arrTag = {};
let str = "";
let i = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册