OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "test/cctest/test-api.h" | 7 #include "test/cctest/test-api.h" |
8 | 8 |
9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 // Force the list of returned keys to be stored in a Arguments object. | 1575 // Force the list of returned keys to be stored in a Arguments object. |
1576 Local<Script> indexed_property_names_script = v8_compile( | 1576 Local<Script> indexed_property_names_script = v8_compile( |
1577 "function f(w,x) {" | 1577 "function f(w,x) {" |
1578 " return arguments;" | 1578 " return arguments;" |
1579 "}" | 1579 "}" |
1580 "keys = f(0, 1, 2, 3);" | 1580 "keys = f(0, 1, 2, 3);" |
1581 "keys;"); | 1581 "keys;"); |
1582 Local<Object> result = | 1582 Local<Object> result = |
1583 Local<Object>::Cast(indexed_property_names_script->Run()); | 1583 Local<Object>::Cast(indexed_property_names_script->Run()); |
1584 // Have to populate the handle manually, as it's not Cast-able. | 1584 // Have to populate the handle manually, as it's not Cast-able. |
1585 i::Handle<i::JSObject> o = v8::Utils::OpenHandle<Object, i::JSObject>(result); | 1585 i::Handle<i::JSReceiver> o = |
| 1586 v8::Utils::OpenHandle<Object, i::JSReceiver>(result); |
1586 i::Handle<i::JSArray> array(reinterpret_cast<i::JSArray*>(*o)); | 1587 i::Handle<i::JSArray> array(reinterpret_cast<i::JSArray*>(*o)); |
1587 info.GetReturnValue().Set(v8::Utils::ToLocal(array)); | 1588 info.GetReturnValue().Set(v8::Utils::ToLocal(array)); |
1588 } | 1589 } |
1589 | 1590 |
1590 | 1591 |
1591 static void SloppyIndexedPropertyGetter( | 1592 static void SloppyIndexedPropertyGetter( |
1592 uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { | 1593 uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { |
1593 ApiTestFuzzer::Fuzz(); | 1594 ApiTestFuzzer::Fuzz(); |
1594 if (index < 4) { | 1595 if (index < 4) { |
1595 info.GetReturnValue().Set(v8_num(index)); | 1596 info.GetReturnValue().Set(v8_num(index)); |
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3381 "var obj = intercepted_1;" | 3382 "var obj = intercepted_1;" |
3382 "obj.x = 4;" | 3383 "obj.x = 4;" |
3383 "eval('obj.x');" | 3384 "eval('obj.x');" |
3384 "eval('obj.x');" | 3385 "eval('obj.x');" |
3385 "eval('obj.x');" | 3386 "eval('obj.x');" |
3386 "obj = intercepted_2;" | 3387 "obj = intercepted_2;" |
3387 "obj.x = 9;" | 3388 "obj.x = 9;" |
3388 "eval('obj.x');", | 3389 "eval('obj.x');", |
3389 9); | 3390 9); |
3390 } | 3391 } |
OLD | NEW |