Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
917922ed
Commit
917922ed
authored
Jan 18, 2020
by
Vinicius Jarina
Browse files
Removed unused code.
parent
ceac1a5f
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Metatables.cs
View file @
917922ed
...
@@ -227,7 +227,6 @@ namespace NLua
...
@@ -227,7 +227,6 @@ namespace NLua
if
(
obj1
==
null
)
if
(
obj1
==
null
)
{
{
translator
.
ThrowError
(
luaState
,
"Cannot negate a nil object"
);
translator
.
ThrowError
(
luaState
,
"Cannot negate a nil object"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -237,7 +236,6 @@ namespace NLua
...
@@ -237,7 +236,6 @@ namespace NLua
if
(
opUnaryNegation
==
null
)
if
(
opUnaryNegation
==
null
)
{
{
translator
.
ThrowError
(
luaState
,
"Cannot negate object ("
+
type
.
Name
+
" does not overload the operator -)"
);
translator
.
ThrowError
(
luaState
,
"Cannot negate object ("
+
type
.
Name
+
" does not overload the operator -)"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
obj1
=
opUnaryNegation
.
Invoke
(
obj1
,
new
[]
{
obj1
});
obj1
=
opUnaryNegation
.
Invoke
(
obj1
,
new
[]
{
obj1
});
...
@@ -337,7 +335,6 @@ namespace NLua
...
@@ -337,7 +335,6 @@ namespace NLua
if
(
obj
==
null
)
if
(
obj
==
null
)
{
{
_translator
.
ThrowError
(
luaState
,
"Trying to index an invalid object reference"
);
_translator
.
ThrowError
(
luaState
,
"Trying to index an invalid object reference"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -552,7 +549,6 @@ namespace NLua
...
@@ -552,7 +549,6 @@ namespace NLua
if
(!
found
)
if
(!
found
)
{
{
_translator
.
ThrowError
(
luaState
,
"key not found: "
+
index
);
_translator
.
ThrowError
(
luaState
,
"key not found: "
+
index
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -567,7 +563,6 @@ namespace NLua
...
@@ -567,7 +563,6 @@ namespace NLua
else
else
_translator
.
ThrowError
(
luaState
,
"exception indexing '"
+
index
+
"' "
+
e
.
Message
);
_translator
.
ThrowError
(
luaState
,
"exception indexing '"
+
index
+
"' "
+
e
.
Message
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
}
}
...
@@ -614,7 +609,6 @@ namespace NLua
...
@@ -614,7 +609,6 @@ namespace NLua
else
else
_translator
.
ThrowError
(
luaState
,
"exception indexing '"
+
index
+
"' "
+
e
.
Message
);
_translator
.
ThrowError
(
luaState
,
"exception indexing '"
+
index
+
"' "
+
e
.
Message
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
}
}
...
@@ -643,8 +637,6 @@ namespace NLua
...
@@ -643,8 +637,6 @@ namespace NLua
if
(
obj
==
null
)
if
(
obj
==
null
)
{
{
_translator
.
ThrowError
(
luaState
,
"Trying to index an invalid object reference"
);
_translator
.
ThrowError
(
luaState
,
"Trying to index an invalid object reference"
);
//luaState.PushNil();
//luaState.PushBoolean(false);
return
2
;
return
2
;
}
}
...
@@ -851,7 +843,6 @@ namespace NLua
...
@@ -851,7 +843,6 @@ namespace NLua
{
{
// If we reach this point we found a static method, but can't use it in this context because the user passed in an instance
// If we reach this point we found a static method, but can't use it in this context because the user passed in an instance
_translator
.
ThrowError
(
luaState
,
"Can't pass instance to static method "
+
methodName
);
_translator
.
ThrowError
(
luaState
,
"Can't pass instance to static method "
+
methodName
);
//luaState.PushNil();
}
}
}
}
else
else
...
@@ -863,7 +854,6 @@ namespace NLua
...
@@ -863,7 +854,6 @@ namespace NLua
// is not sufficient. valid data members may return nil and therefore there must be some
// is not sufficient. valid data members may return nil and therefore there must be some
// way to know the member just doesn't exist.
// way to know the member just doesn't exist.
_translator
.
ThrowError
(
luaState
,
"Unknown member name "
+
methodName
);
_translator
.
ThrowError
(
luaState
,
"Unknown member name "
+
methodName
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -1135,7 +1125,6 @@ namespace NLua
...
@@ -1135,7 +1125,6 @@ namespace NLua
if
(
klass
==
null
)
if
(
klass
==
null
)
{
{
_translator
.
ThrowError
(
luaState
,
"Trying to index an invalid type reference"
);
_translator
.
ThrowError
(
luaState
,
"Trying to index an invalid type reference"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -1249,7 +1238,6 @@ namespace NLua
...
@@ -1249,7 +1238,6 @@ namespace NLua
}
}
_translator
.
ThrowError
(
luaState
,
"Cannot invoke delegate (invalid arguments for "
+
methodDelegate
.
Name
+
")"
);
_translator
.
ThrowError
(
luaState
,
"Cannot invoke delegate (invalid arguments for "
+
methodDelegate
.
Name
+
")"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
...
src/Method/LuaMethodWrapper.cs
View file @
917922ed
...
@@ -220,7 +220,6 @@ namespace NLua.Method
...
@@ -220,7 +220,6 @@ namespace NLua.Method
{
{
_translator
.
ThrowError
(
luaState
,
_translator
.
ThrowError
(
luaState
,
string
.
Format
(
"instance method '{0}' requires a non null target object"
,
_methodName
));
string
.
Format
(
"instance method '{0}' requires a non null target object"
,
_methodName
));
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -251,7 +250,6 @@ namespace NLua.Method
...
@@ -251,7 +250,6 @@ namespace NLua.Method
?
"Invalid arguments to method call"
?
"Invalid arguments to method call"
:
(
"Invalid arguments to method: "
+
candidateName
);
:
(
"Invalid arguments to method: "
+
candidateName
);
_translator
.
ThrowError
(
luaState
,
msg
);
_translator
.
ThrowError
(
luaState
,
msg
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
@@ -317,7 +315,6 @@ namespace NLua.Method
...
@@ -317,7 +315,6 @@ namespace NLua.Method
if
(!
_translator
.
MatchParameters
(
luaState
,
methodToCall
,
_lastCalledMethod
,
0
))
if
(!
_translator
.
MatchParameters
(
luaState
,
methodToCall
,
_lastCalledMethod
,
0
))
{
{
_translator
.
ThrowError
(
luaState
,
"Invalid arguments to method call"
);
_translator
.
ThrowError
(
luaState
,
"Invalid arguments to method call"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
}
}
...
@@ -327,7 +324,6 @@ namespace NLua.Method
...
@@ -327,7 +324,6 @@ namespace NLua.Method
{
{
_translator
.
ThrowError
(
luaState
,
_translator
.
ThrowError
(
luaState
,
"Unable to invoke method on generic class as the current method is an open generic method"
);
"Unable to invoke method on generic class as the current method is an open generic method"
);
//luaState.PushNil();
return
1
;
return
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment