mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
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:
parent
9c7c9cf7d9
commit
4df5e8e015
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user