Пример #1
0
static void
emit_error_on_eval_and_arguments (jsp_operand_t op, locus loc __attr_unused___)
{
  if (op.is_literal_operand ())
  {
    if (lit_literal_equal_type_utf8 (lit_get_literal_by_cp (op.get_literal ()),
                                     lit_get_magic_string_utf8 (LIT_MAGIC_STRING_ARGUMENTS),
                                     lit_get_magic_string_size (LIT_MAGIC_STRING_ARGUMENTS))
        || lit_literal_equal_type_utf8 (lit_get_literal_by_cp (op.get_literal ()),
                                        lit_get_magic_string_utf8 (LIT_MAGIC_STRING_EVAL),
                                        lit_get_magic_string_size (LIT_MAGIC_STRING_EVAL)))
    {
      PARSE_ERROR (JSP_EARLY_ERROR_SYNTAX, "'eval' and 'arguments' are not allowed here in strict mode", loc);
    }
  }
}
void
jsp_early_error_check_for_eval_and_arguments_in_strict_mode (jsp_operand_t op, bool is_strict, locus loc)
{
  if (is_strict)
  {
    lit_cpointer_t lit_cp;

    if (op.is_string_lit_operand ()
        || op.is_number_lit_operand ())
    {
      lit_cp = op.get_literal ();
    }
    else if (op.is_identifier_operand ())
    {
      lit_cp = op.get_identifier_name ();
    }
    else
    {
      return;
    }

    jsp_early_error_emit_error_on_eval_and_arguments (lit_get_literal_by_cp (lit_cp), loc);
  }
}
Пример #3
0
void jsp_early_error_add_varg (jsp_operand_t op)
{
  JERRY_ASSERT (op.is_literal_operand ());
  STACK_PUSH (props, create_prop_literal (lit_get_literal_by_cp (op.get_literal ()), VARG));
}
Пример #4
0
void
jsp_early_error_add_prop_name (jsp_operand_t op, prop_type pt)
{
  JERRY_ASSERT (op.is_literal_operand ());
  STACK_PUSH (props, create_prop_literal (lit_get_literal_by_cp (op.get_literal ()), pt));
}