Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change alert for console.log, extend example

  • Loading branch information...
commit 1e91879b0b6aae0ae66f51779f4011445d771590 1 parent 334694c
Siedrix authored
Showing with 35 additions and 3 deletions.
  1. +2 −2 neon.js
  2. +33 −1 node.js
View
4 neon.js
@@ -135,7 +135,7 @@ global.Class = function Class(classNameOrNameSpace, className){
for(i = 0, il = newClass.__implementedInterfaces.length; i < il; i++){
for(j = 0, jl = newClass.__implementedInterfaces[i].constructor.length; j < jl; j++){
if(!newClass[ newClass.__implementedInterfaces[i].constructor[j] ]){
- alert('must implement static ' + newClass.__implementedInterfaces[i].name);
+ console.log('must implement static ' + newClass.__implementedInterfaces[i].name);
break;
}
}
@@ -144,7 +144,7 @@ global.Class = function Class(classNameOrNameSpace, className){
&& newClass.__implementedInterfaces[i].prototype){
for(j = 0, jl = newClass.__implementedInterfaces[i].prototype.length; j < jl; j++){
if(!newClass.prototype[newClass.__implementedInterfaces[i].prototype[j]]){
- alert('must implement prototype ' + newClass.__implementedInterfaces[i].name);
+ console.log('must implement prototype ' + newClass.__implementedInterfaces[i].name);
break;
}
}
View
34 node.js
@@ -10,4 +10,36 @@ var Interface = Neon.Interface;
console.log('Neon Class :',typeof Class);
console.log('Module :',typeof Module);
-console.log('Interface :',typeof Interface);
+console.log('Interface :',typeof Interface);
+
+Module('Composition')({
+ y : 5,
+ prototype : {
+ z : 3
+ }
+});
+
+Interface('Editable')({
+ constructor : ['x'],
+ prototype : ['x']
+});
+
+Class('Widget')({
+
+});
+
+Class('Overlay').inherits(Widget).ensures(Editable).includes(Composition)({
+ html : '<div></div>',
+ x : 10,
+ prototype : {
+ init : function (element){
+ if(!element){
+ element = document.createElement('div');
+ element.innerHTML = 'hola';
+ document.body.appendChild(element);
+ }
+ },
+ x : 10,
+ b : 5
+ }
+});
Please sign in to comment.
Something went wrong with that request. Please try again.