summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example.lua2
-rw-r--r--readme.md2
-rw-r--r--test.lua4
3 files changed, 4 insertions, 4 deletions
diff --git a/example.lua b/example.lua
index 47d25c6..d0f6a72 100644
--- a/example.lua
+++ b/example.lua
@@ -20,7 +20,7 @@ assert(a:is(Object)) -- use `is()` method for it
local Foo = Point:extends() -- you can extend whatever class you want
function Foo:new (str, x, y)
- self.__super.new(self, x, y) -- call super constructor first
+ Foo.__super.new(self, x, y) -- call super constructor first
self.str = str -- do whatever else is left to be done
end
diff --git a/readme.md b/readme.md
index 77f7461..99ad13b 100644
--- a/readme.md
+++ b/readme.md
@@ -26,7 +26,7 @@ assert(a:is(Object)) -- use `is()` method for it
local Foo = Point:extends() -- you can extend whatever class you want
function Foo:new (str, x, y)
- self.__super.new(self, x, y) -- call super constructor first
+ Foo.__super.new(self, x, y) -- call super constructor first
self.str = str -- do whatever else is left to be done
end
diff --git a/test.lua b/test.lua
index e66bd55..46a023e 100644
--- a/test.lua
+++ b/test.lua
@@ -21,7 +21,7 @@ function Child:new (a)
self.a = a
end
function GrandChild:new (b, a)
- self.__super.new(self, a)
+ GrandChild.__super.new(self, a)
self.b = b
end
@@ -75,7 +75,7 @@ function Meta:new (x, y)
self.y = y
end
function Meta.__add (self, op)
- return self.__class(self.x + op.x, self.y + op.y)
+ return Meta(self.x + op.x, self.y + op.y)
end
local x = 5