enof / enofjs Goto Github PK
View Code? Open in Web Editor NEWEnhancing javascript
Home Page: http://enof.github.io/EnoFJS/
Enhancing javascript
Home Page: http://enof.github.io/EnoFJS/
EnoFJS should now be a framework to support extension of classes and no longer serve the purpose to look similar to java/c#.
The reason for this change is to make the framework lighter and easier to implement.
Wrap created classes into a factory to a provided app
this.private = {
foo: {
is: false
},
bar: {
isSet: true
}
}
will generate
this.public = {
isFoo: function generatedIs(){
return this.private.foo;
},
isBar: function generatedIs(){
return this.private.bar;
},
setBar: function generatedSet(value){
this.private.bar = value;
}
}
AS a developer
WHAT delete the last entry
WHY to easily delete the last entry of an LinkedHashList
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Deleting the last entry
THEN
The last entry should be the second entry of the initial list
The last entry should return null when getting the next node
GIVEN
Cat extends Animal
Cat.constructor calls Animal.constructor
Kitten extends Cat
Kitten.constructor calls Cat.constructor
WHEN
Kitten is initialized
THEN
Kitten should have called the constructor of Cat and Animal
ie8 has super keyword reserved and breaks, to make it compatible and also prevent issues with possible future updates from other browsers implementing super, the super keyword will be renamed to sup.
AS a developer
WHAT retrieve the last entry
WHY to easily retrieve the last entry of an LinkedHashList
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Getting the last entry
THEN
returns the last entry of the list
the last entry should return null when getting next
GIVEN
Kitten extends Cat
Cat extends Animal
WHEN
Kitten instance of Animal
THEN
return true
AS a developer
WHAT use a LinkedHashMap
WHY so I can remove entries and add entries easily
AS a developer
WHAT get a node by id(hash)
WHY to easily get a node by position
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Get the second node by id
THEN
The second node should be returned
GIVEN
Cat extends Animal
WHEN
Kitten extends Cat
THEN
Kitten doesn't have any reference of Animal
Make EnoFJS requirejs compatible
AS a developer
WHAT node should have a reference to nodes next to it
WHY to easily get the node next to it
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Get the second node by id
THEN
the second node should have a reference to previous and next
AS a developer
WHAT retrieve the first entry
WHY to easily retrieve the first entry of an LinkedHashList
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Getting the first entry
THEN
returns the first entry of the list
the first entry should return null when getting previous
GIVEN
Cat -> lick throws new Error
Cat -> affect calls lick
Kitten -> lick returns 'LICK'
WHEN
Kitten calls affect
THEN
Kitten -> affect returns LICK
AS a developer
WHAT write a test with configurable variables and expectations
WHY to reuse a test easily
GIVEN
list has one or more entries
WHEN
adding before the first entry
THEN
new node is first entry
GIVEN
list has one or more entried
WHEN
adding after the last entry
THEN
the new node is the last entry
AS a developer
WHAT delete the first entry
WHY to easily delete the first entry of an LinkedHashList
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Deleting the first entry
THEN
The first entry should be the 2nd entry in the list
The first entry should return null
Allow generation of get or set seperately
AS a developer
WHAT add an entry to the list at the first position
WHY to easily add an new entry at the first position without handling reordering
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Adding an entry to the first of the list
THEN
The first entry should be the newly added node
The first entry should have the previously first node as next
The first entry should have null as previous
AS a developer
WHAT add an entry
WHY to easily add an entry to an LinkedHashList
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Adding a new entry
THEN
The new entry should be the last entry
The last entry should have null as next
The previous last entry shoul have the new entry as next
AS a developer
WHAT delete an entry in the middle of the list
WHY to easily remove an node in between a list
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Removing the second entry
THEN
The first entry should have the last entry on the next node
The last entry should have the first entry on the previous node
AS a developer
WHAT add before a node
WHY to easily add an new entry before a node reference
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Adding before the second node
THEN
The added node should be between the first and second node
It would be awesome if we could auto generate getters and setters for an private or protected variable.
hf&gl
AS a developer
WHAT add after a node
WHY to easily add an new entry after a node reference
GIVEN
A LinkedHashList is initialized
The List has 3 entries
WHEN
Adding after the second node
THEN
The added node should be between the second and last node
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.