IOOpen opens the io library. Usually passed to Require.
(l *State)
| 308 | |
| 309 | // IOOpen opens the io library. Usually passed to Require. |
| 310 | func IOOpen(l *State) int { |
| 311 | NewLibrary(l, ioLibrary) |
| 312 | |
| 313 | NewMetaTable(l, fileHandle) |
| 314 | l.PushValue(-1) |
| 315 | l.SetField(-2, "__index") |
| 316 | SetFunctions(l, fileHandleMethods, 0) |
| 317 | l.Pop(1) |
| 318 | |
| 319 | registerStdFile(l, os.Stdin, input, "stdin") |
| 320 | registerStdFile(l, os.Stdout, output, "stdout") |
| 321 | registerStdFile(l, os.Stderr, "", "stderr") |
| 322 | |
| 323 | return 1 |
| 324 | } |
nothing calls this directly
no test coverage detected