зеркало из https://github.com/microsoft/napajs.git
fix bug when transporting 'null' (#181)
This commit is contained in:
Родитель
ab54a359fb
Коммит
0f699c541b
|
@ -68,7 +68,8 @@ export function marshallTransform(jsValue: any, context: transportable.Transport
|
|||
/// <param name="context"> Transport context. </param>
|
||||
/// <returns> Transported value. </returns>
|
||||
function unmarshallTransform(payload: any, context: transportable.TransportContext): any {
|
||||
if (payload != null && payload._cid !== undefined) {
|
||||
if (payload == null) return payload;
|
||||
if (payload._cid !== undefined) {
|
||||
let cid = payload._cid;
|
||||
if (cid === 'function') {
|
||||
return functionTransporter.load(payload.hash);
|
||||
|
|
|
@ -236,7 +236,8 @@ export function simpleTypeTransportTest() {
|
|||
a: 'hello',
|
||||
b: {
|
||||
c: [0, 1]
|
||||
}
|
||||
},
|
||||
c: null
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче