Skip to content

Commit f34a8f3

Browse files
c42fvtjnash
andauthored
Apply suggestions from code review
Co-authored-by: Jameson Nash <[email protected]>
1 parent a050e00 commit f34a8f3

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

base/loading.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ function include_string(mapexpr::Function, mod::Module, code::AbstractString,
11051105
catch exc
11061106
# TODO: Now that stacktraces are more reliable we should remove
11071107
# LoadError and expose the real error type directly.
1108-
rethrow(LoadError(String(loc.file), loc.line, exc))
1108+
rethrow(LoadError(filename, loc.line, exc))
11091109
end
11101110
end
11111111

base/stacktraces.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,9 @@ function Base.parentmodule(frame::StackFrame)
275275
return def
276276
else
277277
return (def::Method).module
278-
return def.module
279278
end
280279
else
281-
# Bug: currently the module is not available for inlined frames and
280+
# the module is not always available (common reasons include inlined frames and frames arising from the interpreter)
282281
# frames arising from the interpreter.
283282
nothing
284283
end
@@ -290,7 +289,7 @@ end
290289
Returns whether the `frame` is from the provided `Module`
291290
"""
292291
function from(frame::StackFrame, m::Module)
293-
parentmodule(frame) == m
292+
return parentmodule(frame) === m
294293
end
295294

296295
end

src/ast.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,13 +1198,11 @@ JL_DLLEXPORT jl_value_t *jl_parse(const char *text, size_t text_len, jl_value_t
11981198
jl_value_t *result = jl_apply(args, 5);
11991199
ptls->world_age = last_age;
12001200
args[0] = result; // root during error checks below
1201-
if (!jl_is_svec(result)) {
1202-
jl_type_error("jl_parse", (jl_value_t*)jl_simplevector_type, result);
1203-
}
1204-
else if (jl_svec_len(result) != 2 || !jl_is_expr(jl_svecref(result, 0)) ||
1205-
!jl_is_long(jl_svecref(result, 1))) {
1206-
jl_error("Result from parser should be `svec(a::Expr, b::Int)`");
1207-
}
1201+
JL_TYPECHK(parse, simplevector, result);
1202+
if (jl_svec_len(result) != 2)
1203+
jl_error("Result from parser should be `svec(a::Expr, b::Int)`");
1204+
JL_TYPECHK(parse, expr, jl_svecref(result, 0));
1205+
JL_TYPECHK(parse, long, jl_svecref(result, 1));
12081206
JL_GC_POP();
12091207
return result;
12101208
}

stdlib/Distributed/test/distributed_exec.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,6 @@ let
14861486
function test_include_fails_to_open_file(fname)
14871487
try
14881488
include(fname)
1489-
false
14901489
catch exc
14911490
path = joinpath(@__DIR__, fname)
14921491
@test exc isa SystemError

0 commit comments

Comments
 (0)