@@ -124,8 +124,8 @@ vmComponent = {
124
124
return tk
125
125
end ,
126
126
invoke = function (com , me , ...)
127
- if not components [com ] then error (" no component " .. com ) end
128
- if not components [com ][me ] then error (" no method " .. com .. " . " .. me ) end
127
+ if not components [com ] then error (" no such component " ) end
128
+ if not components [com ][me ] then error (" no such method " ) end
129
129
return components [com ][me ](... )
130
130
end ,
131
131
proxy = function (com )
@@ -148,8 +148,11 @@ vmComponent = {
148
148
return components [com ].type
149
149
end ,
150
150
methods = function (com )
151
+ if not components [com ] then
152
+ return nil , " no such component"
153
+ end
151
154
local mt = {}
152
- for k , v in pairs (components [address ]) do
155
+ for k , v in pairs (components [com ]) do
153
156
if type (v ) == " function" then
154
157
mt [k ] = true
155
158
end
@@ -164,10 +167,10 @@ vmComponent = {
164
167
end ,
165
168
doc = function (address , method )
166
169
if not components [address ] then
167
- error (" No such component " .. address )
170
+ error (" no such component" )
168
171
end
169
172
if not components [address ][method ] then
170
- error ( " No such method " .. method )
173
+ return
171
174
end
172
175
return tostring (components [address ][method ])
173
176
end
@@ -381,6 +384,7 @@ vmEnvironment = {
381
384
-- This is not exactly the same, but is very similar, to that of machine.lua,
382
385
-- differing mainly in how pullSignal timeout scheduling occurs.
383
386
coroutine = {
387
+ -- NOTE: I can't give you a definitive list from OC because OC (or OpenOS?) screws up a metatable!
384
388
yield = function (...)
385
389
return coroutine.yield (nil , ... )
386
390
end ,
0 commit comments