This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- global | |
people = {} | |
person = class { | |
function(self, name, age) | |
self.name, self.age = name, age | |
table.insert(people, self) | |
end | |
-- generic by default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Class = new Native({ | |
name: 'Class', | |
initialize: function(properties){ | |
properties = properties || {}; | |
var klass = function(){ | |
for (var property in this) this[property] = $unlink(this[property]); | |
this.parent = null; | |
for (var Property in Class.Mutators){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spec = { | |
specs = {}, passed = 0, failed = 0, current = nil | |
} | |
function spec.report(success, message) | |
spec.current.success = success | |
if success then | |
spec.passed = spec.passed + 1 | |
else | |
spec.failed = spec.failed + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = class { | |
length = function() end; | |
['.length'] = function() end; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = class { | |
function(self, data) | |
for k, v in pairs(data) do | |
self[k] = v | |
end | |
end; | |
check = function(...) | |
print(...) | |
end; |
NewerOlder