Permalink
Browse files

memberMissing -> member_missing, yes I was confused about the convent…

…ion of my own language
  • Loading branch information...
1 parent a0d6ef3 commit db6bbc3ab06c2d2106daf87124579836675164cf @buunguyen committed Jun 10, 2012
View
@@ -1,5 +1,5 @@
var obj = {
- memberMissing: func(name) {
+ member_missing: func(name) {
return "Member: {0}".with(name);
}
};
@@ -9,7 +9,7 @@ println(obj.has_member('notExist')); # False
obj = {
- memberMissing: func(name) {
+ member_missing: func(name) {
if (name == "add") {
return func(a, b) { a + b };
}
@@ -19,7 +19,7 @@ obj = {
println(obj.add(1, 2)); # 3
obj = {
- memberMissing: func(name) {
+ member_missing: func(name) {
if (name == "cache") {
return this.cache = func() {};
}
@@ -30,7 +30,7 @@ obj.cache();
println(obj.has_member('cache')); # True
var db = {
- memberMissing: func(name) {
+ member_missing: func(name) {
if (name.starts('find')) {
return db[name] #! cache it !# = func(obj) {
var sql = 'SELECT * FROM {0}'.with(name.sub(4).upper());
@@ -48,4 +48,4 @@ var db = {
};
# SELECT * FROM PRODUCTS WHERE CATEGORYID=1 AND PRICE>1000
-println(db.findProducts({categoryId: 1, price: '>1000'}));
+println(db.findProducts({categoryId: 1, price: '>1000'}));
View
@@ -122,7 +122,7 @@ register( "Object", func() {
register( "Object - Member Missing", func() {
# Bike uses memberMissing, if defined, when it can't resolve a member
var obj = {
- memberMissing: func(name) {
+ member_missing: func(name) {
if (name == "add") {
return func(a, b) { a + b };
}
@@ -566,7 +566,7 @@ public void Scopes()
public void MemberMissing()
{
Interpret(@"var obj = {
- memberMissing: func(name) {
+ member_missing: func(name) {
if (name == 'add') {
return func(a, b) { a + b };
}
@@ -9,7 +9,7 @@
internal static class InterpreterHelper
{
- public const string MemberMissing = "memberMissing";
+ public const string MemberMissing = "member_missing";
public const string SpecialSuffix = "__";
public static object ActAndHandleException(Func<object> func, bool onThread = false)

0 comments on commit db6bbc3

Please sign in to comment.