Fix assertions in RegExp builtin
Related issue: #783, #784 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
@@ -88,13 +88,13 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument
|
|||||||
|
|
||||||
/* Get source. */
|
/* Get source. */
|
||||||
ecma_string_t *magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE);
|
ecma_string_t *magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_SOURCE);
|
||||||
ecma_property_t *prop_p = ecma_get_named_data_property (target_p, magic_string_p);
|
ecma_property_t *prop_p = ecma_op_object_get_property (target_p, magic_string_p);
|
||||||
pattern_string_p = ecma_get_string_from_value (ecma_get_named_data_property_value (prop_p));
|
pattern_string_p = ecma_get_string_from_value (ecma_get_named_data_property_value (prop_p));
|
||||||
ecma_deref_ecma_string (magic_string_p);
|
ecma_deref_ecma_string (magic_string_p);
|
||||||
|
|
||||||
/* Get flags. */
|
/* Get flags. */
|
||||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
|
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_GLOBAL);
|
||||||
prop_p = ecma_get_named_data_property (target_p, magic_string_p);
|
prop_p = ecma_op_object_get_property (target_p, magic_string_p);
|
||||||
|
|
||||||
if (ecma_is_value_true (ecma_get_named_data_property_value (prop_p)))
|
if (ecma_is_value_true (ecma_get_named_data_property_value (prop_p)))
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument
|
|||||||
|
|
||||||
ecma_deref_ecma_string (magic_string_p);
|
ecma_deref_ecma_string (magic_string_p);
|
||||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL);
|
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_IGNORECASE_UL);
|
||||||
prop_p = ecma_get_named_data_property (target_p, magic_string_p);
|
prop_p = ecma_op_object_get_property (target_p, magic_string_p);
|
||||||
|
|
||||||
if (ecma_is_value_true (ecma_get_named_data_property_value (prop_p)))
|
if (ecma_is_value_true (ecma_get_named_data_property_value (prop_p)))
|
||||||
{
|
{
|
||||||
@@ -112,7 +112,7 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument
|
|||||||
|
|
||||||
ecma_deref_ecma_string (magic_string_p);
|
ecma_deref_ecma_string (magic_string_p);
|
||||||
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE);
|
magic_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_MULTILINE);
|
||||||
prop_p = ecma_get_named_data_property (target_p, magic_string_p);
|
prop_p = ecma_op_object_get_property (target_p, magic_string_p);
|
||||||
|
|
||||||
if (ecma_is_value_true (ecma_get_named_data_property_value (prop_p)))
|
if (ecma_is_value_true (ecma_get_named_data_property_value (prop_p)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2016 Samsung Electronics Co., Ltd.
|
||||||
|
// Copyright 2016 University of Szeged.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
RegExp.prototype.compile(RegExp.prototype);
|
||||||
Reference in New Issue
Block a user