Skip to content

Commit

Permalink
fix extending class with conflicting method's name
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Dec 30, 2016
1 parent 84a595d commit 083c9cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@kaoscript/runtime",
"description": "The default runtime for kaoscript",
"version": "0.4.0",
"version": "0.4.1",
"author": {
"name": "Baptiste Augrain",
"email": "daiyam@zokugun.org"
Expand Down
14 changes: 7 additions & 7 deletions src/runtime.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* runtime.js
* Version 0.4.0
* Version 0.4.1
* September 14th, 2016
*
* Copyright (c) 2016 Baptiste Augrain
Expand Down Expand Up @@ -836,7 +836,7 @@ var Helper = {
var name = options.name;
var methods = [];

if(options.class.__ks_reflect && options.class.__ks_reflect.classMethods[name]) {
if(options.class.__ks_reflect && Type.isArray(options.class.__ks_reflect.classMethods[name])) {
methods.push.apply(methods, options.class.__ks_reflect.classMethods[name]);
}

Expand All @@ -846,7 +846,7 @@ var Helper = {
classMethods: {}
};
}
if(!options.sealed.__ks_reflect.classMethods[name]) {
if(!Type.isArray(options.sealed.__ks_reflect.classMethods[name])) {
options.sealed.__ks_reflect.classMethods[name] = [];
}
methods.push.apply(methods, options.sealed.__ks_reflect.classMethods[name]);
Expand Down Expand Up @@ -881,7 +881,7 @@ var Helper = {
var name = options.name;
var reflect = options.class.__ks_reflect;

if(!reflect.classMethods[name]) {
if(!Type.isArray(reflect.classMethods[name])) {
reflect.classMethods[name] = [];
}

Expand Down Expand Up @@ -922,7 +922,7 @@ var Helper = {
var name = options.name;
var methods = [];

if(options.class.__ks_reflect && options.class.__ks_reflect.instanceMethods[name]) {
if(options.class.__ks_reflect && Type.isArray(options.class.__ks_reflect.instanceMethods[name])) {
methods.push.apply(methods, options.class.__ks_reflect.instanceMethods[name]);
}

Expand All @@ -932,7 +932,7 @@ var Helper = {
classMethods: {}
};
}
if(!options.sealed.__ks_reflect.instanceMethods[name]) {
if(!Type.isArray(options.sealed.__ks_reflect.instanceMethods[name])) {
options.sealed.__ks_reflect.instanceMethods[name] = [];
}
methods.push.apply(methods, options.sealed.__ks_reflect.instanceMethods[name]);
Expand Down Expand Up @@ -977,7 +977,7 @@ var Helper = {
var name = options.name;
var reflect = options.class.__ks_reflect;

if(!reflect.instanceMethods[name]) {
if(!Type.isArray(reflect.instanceMethods[name])) {
reflect.instanceMethods[name] = [];
}

Expand Down

0 comments on commit 083c9cd

Please sign in to comment.