Changeset 5556 for luci/trunk/libs/cbi/luasrc/cbi.lua
- Timestamp:
- 11/17/09 17:12:53 (4 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/cbi/luasrc/cbi.lua (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/cbi/luasrc/cbi.lua
r5527 r5556 520 520 521 521 function Delegator.set(self, name, node) 522 if type(node) == "table" and getmetatable(node) == nil then523 node = Compound(unpack(node))524 end525 assert(type(node) == "function" or instanceof(node, Compound), "Invalid")526 522 assert(not self.nodes[name], "Duplicate entry") 527 523 … … 563 559 564 560 function Delegator.get(self, name) 565 return self.nodes[name] 561 local node = self.nodes[name] 562 563 if type(node) == "string" then 564 node = load(node) 565 end 566 567 if type(node) == "table" and getmetatable(node) == nil then 568 node = Compound(unpack(node)) 569 end 570 571 return node 566 572 end 567 573
