Skip to content

Commit

Permalink
fixed inheritance typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 16, 2011
1 parent 50cebe8 commit 00c4fa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/compile.js
Expand Up @@ -41,9 +41,9 @@ function parse(js) {

function parseInheritance(js) {
return js
.replace(/^ *(\w+)\.prototype\.__proto__ * = *(\w+)/gm, function(_, child, parent){
.replace(/^ *(\w+)\.prototype\.__proto__ * = *(\w+)\.prototype *;?/gm, function(_, child, parent){
return child + '.prototype = new ' + parent + ';\n'
+ child + '.prototype.constructor = '+ child + '\n';
+ child + '.prototype.constructor = '+ child + ';\n';
});
}

Expand Down

0 comments on commit 00c4fa5

Please sign in to comment.