Skip to content

Commit

Permalink
Add constructor to record's prototype.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtth committed Nov 20, 2015
1 parent 73f2a57 commit e045c82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/schemas.js
Expand Up @@ -1473,6 +1473,7 @@ RecordType.prototype._createConstructor = function (isError) {
var self = this;
Record.getType = function () { return self; };
Record.prototype = {
constructor: Record,
$clone: function (opts) { return self.clone(this, opts); },
$compare: function (val) { return self.compare(this, val); },
$getType: Record.getType,
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "avsc",
"version": "3.0.1",
"version": "3.0.2",
"description": "Blazing fast serialization",
"homepage": "https://github.com/mtth/avsc",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions test/test_schemas.js
Expand Up @@ -1100,6 +1100,7 @@ suite('types', function () {
var Person = type.getRecordConstructor();
var p = new Person();
assert.equal(p.age, 25);
assert.strictEqual(p.constructor, Person);
});

test('default check & write', function () {
Expand Down

0 comments on commit e045c82

Please sign in to comment.