Skip to content

Commit 75e48c1

Browse files
Remove invalid assertion in ecma_builtin_global_object_eval.
The removed assertion checked that `this` argument can't be equal to `undefined` in direct call to eval. Actually, `this` can be not equal to `undefined` in case direct call to eval is performed from `with` block. Related issue: #212 JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
1 parent 7d4569a commit 75e48c1

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

jerry-core/ecma/builtin-objects/ecma-builtin-global.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */
6060
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
6161

6262
bool is_direct_eval = vm_is_direct_eval_form_call ();
63-
JERRY_ASSERT (!(is_direct_eval
64-
&& !ecma_is_value_undefined (this_arg)));
6563

6664
/* See also: ECMA-262 v5, 10.1.1 */
6765
bool is_called_from_strict_mode_code;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2015 Samsung Electronics Co., Ltd.
2+
// Copyright 2015 University of Szeged.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
with(0xB276)
17+
eval("foo = true;");

0 commit comments

Comments
 (0)