 #-----------------------------------------------------------------------------------------------------------
 new_local_state = ->
   R =
-    layout_name_stack:              []
     selectors_and_content_events:   {}
     layout_events:                  {}
     content_buffer:                 null
     within_field:                   false
+    layout_name_stack:              []
     ### TAINT we use this attribute to communicate the current selector from `$handle_fields()` back to
     `$handle_content_events()`; this works b/c we're assuming that all event handling is happening in
     lockstep. It might stop working as soon as the lockstepping is broken by an intervening asynchronous
     or buffering stream transform. ###
-    ### TAINT use `field_selector_stack` ###
-    current_field_selector:         null
+    ### TAINT used to store `layout_name` as well, already in `layout_name_stack` ###
+    field_selector_stack:           []
   return R
 
 

#-----------------------------------------------------------------------------------------------------------
@get_current_layout_name = ( S, L ) ->
  unless ( R = L.layout_name_stack[ L.layout_name_stack.length - 1 ] )?
    throw new Error "#{badge}#µ4451 layout stack empty"
  return R

#-----------------------------------------------------------------------------------------------------------
@get_enclosing_layout_name = ( S, L ) ->

        throw new Error "#{badge}#µ2132 missing <field> tag attribute 'key' in table #{rpr layout_name} (#{jr event})"
      ### TAINT this is exactly the kind of dangerous 'sound have happened anywhere, anytime' state mutation
      that advocates of immutable state are warning us about: ###
      @push_field_selector S, L, layout_name, Q.key
      content_buffer            = @new_content_buffer S, L, layout_name,  Q.key
      return send stamp event
    #.......................................................................................................
    if select event, ')', 'field'
      within_field              = false
      content_buffer            = null
      @pop_field_selector S, L
      return send stamp event
    #.......................................................................................................
    if within_field
