Skip to content

Commit 870e01a

Browse files
authored
minor updates (#690)
- use `getglobal`/`isdefinedglobal` instead of `getfield`/`isdefined` - removed unnecessary `LineNumberNode` attachment
1 parent d1a674e commit 870e01a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/construct.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ function queuenext!(iter::ExprSplitter)
487487
if head === :module
488488
# Find or create the module
489489
newname = ex.args[2]::Symbol
490-
if invokelatest(isdefined, mod, newname)
491-
newmod = invokelatest(getfield, mod, newname)
490+
if invokelatest(isdefinedglobal, mod, newname)
491+
newmod = invokelatest(getglobal, mod, newname)
492492
newmod isa Module || throw(ErrorException("invalid redefinition of constant $(newname)"))
493493
mod = newmod
494494
else
@@ -508,7 +508,7 @@ function queuenext!(iter::ExprSplitter)
508508
mod = Base.root_module(id)::Module
509509
else
510510
loc = firstline(ex)
511-
mod = Core.eval(mod, Expr(:module, ex.args[1], newname, Expr(:block, loc, loc)))::Module
511+
mod = Core.eval(mod, Expr(:module, ex.args[1], newname, Expr(:block, loc)))::Module
512512
end
513513
end
514514
# We've handled the module declaration, remove it and queue the body

0 commit comments

Comments
 (0)