Skip to content

Commit ce6e3bd

Browse files
committed
if object has no constructor, return 'Object'
1 parent 4ccbd29 commit ce6e3bd

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Ma Bingyao <[email protected]>",
33
"name": "hprose-html5",
4-
"version": "2.0.31",
4+
"version": "2.0.32",
55
"description": "Hprose is a High Performance Remote Object Service Engine.",
66
"keywords": [
77
"hprose",

dist/hprose-html5.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hprose-html5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hprose-html5.src.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Hprose for HTML5 v2.0.31
1+
// Hprose for HTML5 v2.0.32
22
// Copyright (c) 2008-2016 http://hprose.com
33
// Hprose is freely distributable under the MIT license.
44
// For all details and documentation:
@@ -2671,7 +2671,7 @@ hprose.global = (
26712671
* *
26722672
* hprose Writer for HTML5. *
26732673
* *
2674-
* LastModified: Nov 18, 2016 *
2674+
* LastModified: Feb 13, 2017 *
26752675
* Author: Ma Bingyao <[email protected]> *
26762676
* *
26772677
\**********************************************************/
@@ -2686,6 +2686,9 @@ hprose.global = (
26862686

26872687
function getClassName(obj) {
26882688
var cls = obj.constructor;
2689+
if (!cls) {
2690+
return 'Object';
2691+
}
26892692
var classname = ClassManager.getClassAlias(cls);
26902693
if (classname) { return classname; }
26912694
if (cls.name) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hprose-html5",
3-
"version": "2.0.31",
3+
"version": "2.0.32",
44
"description": "Hprose is a High Performance Remote Object Service Engine.",
55
"homepage": "https://github.com/hprose/hprose-html5",
66
"keywords": [
@@ -49,7 +49,7 @@
4949
"directories": {
5050
"lib": "dist/"
5151
},
52-
"main": "dist/hprose-html5.js",
52+
"main": "dist/hprose-html5.src.js",
5353
"devDependencies": {
5454
"promises-aplus-tests": "*"
5555
},
@@ -67,7 +67,7 @@
6767
"source": "git",
6868
"target": "git://github.com/hprose/hprose-html5.git",
6969
"basePath": "dist/",
70-
"files": [ "hprose-html5.js" ]
70+
"files": [ "hprose-html5.src.js" ]
7171
},
7272
"bugs": {
7373
"url": "https://github.com/hprose/hprose-html5/issues",

src/CopyRight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Hprose for HTML5 v2.0.31
1+
// Hprose for HTML5 v2.0.32
22
// Copyright (c) 2008-2016 http://hprose.com
33
// Hprose is freely distributable under the MIT license.
44
// For all details and documentation:

src/Writer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* *
1414
* hprose Writer for HTML5. *
1515
* *
16-
* LastModified: Nov 18, 2016 *
16+
* LastModified: Feb 13, 2017 *
1717
* Author: Ma Bingyao <[email protected]> *
1818
* *
1919
\**********************************************************/
@@ -28,6 +28,9 @@
2828

2929
function getClassName(obj) {
3030
var cls = obj.constructor;
31+
if (!cls) {
32+
return 'Object';
33+
}
3134
var classname = ClassManager.getClassAlias(cls);
3235
if (classname) { return classname; }
3336
if (cls.name) {

0 commit comments

Comments
 (0)