[ruby-cvs:74103] ko1:r66999 (trunk): check and show a warning for incorrect yield.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Mon Feb 4 16:10:05 JST 2019


ko1	2019-02-04 16:10:05 +0900 (Mon, 04 Feb 2019)

  New Revision: 66999

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66999

  Log:
    check and show a warning for incorrect yield.
    
    * compile.c (check_yield_place): this function check the yield location.
      * show a warning if yield in `class` syntax. [Feature #15575]
    
      * do strict check for toplevel `yield`. Without this patch,
        `1.times{ yield }` in toplevel is valid-syntax (raise LocalJumpError
        at runtime) although toplevel simple `yield` is not valid syntax.
        This patch make them syntax error.

  Modified files:
    trunk/compile.c


More information about the ruby-cvs mailing list