Skip to content

Commit c443572

Browse files
committed
Release 2.3.0
1 parent 1e6a9fc commit c443572

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

History.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
2.3.0 / 2017-07-25
3+
==================
4+
5+
* feat: map key is object should try to use `name` propery (#78)
6+
27
2.2.2 / 2017-07-13
38
==================
49

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hessian.js",
3-
"version": "2.2.2",
3+
"version": "2.3.0",
44
"description": "Hessian Serialization written by pure JavaScript, support all kind of types in Java.",
55
"main": "index.js",
66
"files": [

test/object.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,20 @@ describe('object.test.js', function () {
868868
rs.should.eql({ 'KEY': 'hello' });
869869
});
870870

871+
it('use obj when name property missing', function() {
872+
var key = {
873+
$class: 'com.hessian.enums.TestEnum',
874+
$: {
875+
name1: 'KEY',
876+
},
877+
};
878+
var obj = new Map();
879+
obj.set(key, 'hello');
880+
var buf = hessian.encode(obj);
881+
var rs = hessian.decode(buf);
882+
rs.should.eql({ '[object Object]': 'hello' });
883+
});
884+
871885
it('enum should use name v2', function() {
872886
var key = {
873887
$class: 'com.hessian.enums.TestEnum',

0 commit comments

Comments
 (0)