Use exported methods to access ports

Commit 734eb95 changed most uses of `fm.ports[x].` to a public method
that makes the intent clearer. This changes a couple of uses that were
overlooked by that prior change.
This commit is contained in:
Kurtis Rader 2020-11-16 19:34:35 -08:00 committed by Qi Xiao
parent 9c7c9cf7d9
commit 4df5e8e015
3 changed files with 4 additions and 4 deletions

View File

@ -317,14 +317,14 @@ func evalModule(fm *Frame, key string, src parse.Source, st *StackTrace) (Ns, er
// Evaluates a source. Shared by evalModule and the eval builtin.
func evalInner(fm *Frame, src parse.Source, ns Ns, st *StackTrace) error {
tree, err := parse.ParseWithDeprecation(src, fm.ports[2].File)
tree, err := parse.ParseWithDeprecation(src, fm.ErrorFile())
if err != nil {
return err
}
newFm := &Frame{
fm.Evaler, src, ns, make(Ns),
fm.intCh, fm.ports, fm.traceback, fm.background}
op, err := compile(newFm.Builtin.static(), ns.static(), tree, fm.ports[2].File)
op, err := compile(newFm.Builtin.static(), ns.static(), tree, fm.ErrorFile())
if err != nil {
return err
}

View File

@ -175,7 +175,7 @@ func (op *pipelineOp) exec(fm *Frame) error {
if fm.Editor != nil {
fm.Editor.Notify("%s", msg)
} else {
fm.ports[2].File.WriteString(msg + "\n")
fm.ErrorFile().WriteString(msg + "\n")
}
}
}()

View File

@ -199,6 +199,6 @@ func (fm *Frame) Deprecate(msg string, ctx *diag.Context) {
if prog.ShowDeprecations && fm.deprecations.register(dep) {
err := diag.Error{
Type: "deprecation", Message: dep.message, Context: *ctx}
fm.ports[2].File.WriteString(err.Show("") + "\n")
fm.ErrorFile().WriteString(err.Show("") + "\n")
}
}