(L *LState)
| 385 | } |
| 386 | |
| 387 | func baseSetMetatable(L *LState) int { |
| 388 | L.CheckTypes(2, LTNil, LTTable) |
| 389 | obj := L.Get(1) |
| 390 | if obj == LNil { |
| 391 | L.RaiseError("cannot set metatable to a nil object.") |
| 392 | } |
| 393 | mt := L.Get(2) |
| 394 | if m := L.metatable(obj, true); m != LNil { |
| 395 | if tb, ok := m.(*LTable); ok && tb.RawGetString("__metatable") != LNil { |
| 396 | L.RaiseError("cannot change a protected metatable") |
| 397 | } |
| 398 | } |
| 399 | L.SetMetatable(obj, mt) |
| 400 | L.SetTop(1) |
| 401 | return 1 |
| 402 | } |
| 403 | |
| 404 | func baseToNumber(L *LState) int { |
| 405 | base := L.OptInt(2, 10) |
nothing calls this directly
no test coverage detected
searching dependent graphs…