From: Kevin Sawicki Date: Wed, 6 Jul 2016 20:06:48 +0000 (-0700) Subject: Use empty string constructor name when missing X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9b43a0fc9b9ae00fc02eb08e2f012040b8f303a;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Use empty string constructor name when missing --- diff --git a/lib/renderer/api/remote.js b/lib/renderer/api/remote.js index b120bed..79fe41e 100644 --- a/lib/renderer/api/remote.js +++ b/lib/renderer/api/remote.js @@ -60,7 +60,7 @@ var wrapArgs = function (args, visited) { ret = { type: 'object', - name: value.constructor != null ? value.constructor.name : 'Object', + name: value.constructor != null ? value.constructor.name : '', members: [] } for (prop in value) { diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index 6b0222d..2d439af 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -31,10 +31,11 @@ describe('ipc module', function () { it('should work when object has no prototype', function () { var a = remote.require(path.join(fixtures, 'module', 'no-prototype.js')) + assert.equal(a.foo.constructor.name, '') assert.equal(a.foo.bar, 'baz') assert.equal(a.foo.baz, false) assert.equal(a.bar, 1234) - assert.equal(a.getConstructorName(Object.create(null)), 'Object') + assert.equal(a.getConstructorName(Object.create(null)), '') assert.equal(a.getConstructorName(new (class {})), '') })