Index: DEPRECATED.pod =================================================================== --- DEPRECATED.pod (revision 48452) +++ DEPRECATED.pod (working copy) @@ -206,12 +206,6 @@ L -=item find_lex [eligible in 2.4] - -find_lex will not throw exception for non-existing lexicals. - -L - =item inplace string updates. [eligible in 2.4] All "inplace" string update ops are deprecated. E.g. "chopn_s", etc. @@ -251,7 +245,7 @@ =item errorson, errorsoff operations [eligible in 2.7] -The C<.PARROT_ERRORS_GLOBAL_FLAG> flag will be eliminated. It is not used by Parrot. +The C<.PARROT_ERRORS_GLOBALS_FLAG> flag will be eliminated. It is not used by Parrot. =back Index: src/ops/var.ops =================================================================== --- src/ops/var.ops (revision 48320) +++ src/ops/var.ops (working copy) @@ -86,10 +86,8 @@ =item B(out PMC, in STR) -Find the lexical variable named $2 and store it in $1. This -opcode either throws an exception or returns a Null PMC for the failure case, -depending on the implementation of the LexPad PMC. Parrot's -standard LexPad throws an exception for non-existent names. +Find the lexical variable named $2 and store it in $1. Return a +Null PMC if the variable is not found. =cut @@ -100,14 +98,8 @@ PMC * const result = PMC_IS_NULL(lex_pad) - ? NULL + ? PMCNULL : VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name); - if (!result) { - opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, - EXCEPTION_LEX_NOT_FOUND, - "Lexical '%Ss' not found", lex_name); - goto ADDRESS(handler); - } $1 = result; } Index: t/op/lexicals.t =================================================================== --- t/op/lexicals.t (revision 48320) +++ t/op/lexicals.t (working copy) @@ -840,7 +840,7 @@ /Null PMC access/ OUT -pir_error_output_like( <<'CODE', <<'OUTPUT', 'get non existing' ); +pir_output_is( <<'CODE', <<'OUTPUT', 'get undefined lexical' ); .sub "main" :main .lex 'a', $P0 foo() @@ -852,9 +852,14 @@ .sub bar :outer('foo') .lex 'c', $P0 $P2 = find_lex 'no_such' + if null $P2 goto ok + print "Undefined name not NULL\n" + end +ok: + print "ok\n" .end CODE -/Lexical 'no_such' not found/ +ok OUTPUT pir_output_is( <<'CODE', <<'OUTPUT', 'find_name on lexicals' );