Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: test/cctest/test-api-interceptors.cc

Issue 1409073005: [runtime] use std::vector in KeyAccumulator (Closed)
Patch Set: typo Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
2003 " result.push(prop);" 2003 " result.push(prop);"
2004 "}" 2004 "}"
2005 "result")); 2005 "result"));
2006 // Check that we get all the property names returned including the 2006 // Check that we get all the property names returned including the
2007 // ones from the enumerators in the right order: indexed properties 2007 // ones from the enumerators in the right order: indexed properties
2008 // in numerical order, indexed interceptor properties, named 2008 // in numerical order, indexed interceptor properties, named
2009 // properties in insertion order, named interceptor properties. 2009 // properties in insertion order, named interceptor properties.
2010 // This order is not mandated by the spec, so this test is just 2010 // This order is not mandated by the spec, so this test is just
2011 // documenting our behavior. 2011 // documenting our behavior.
2012 CHECK_EQ(17u, result->Length()); 2012 CHECK_EQ(17u, result->Length());
2013 // Indexed properties in numerical order. 2013 // Indexed properties + indexed interceptor properties in numerical order.
2014 CHECK(v8_str("5")->Equals(result->Get(v8::Integer::New(isolate, 0)))); 2014 CHECK(v8_str("0")->Equals(result->Get(v8::Integer::New(isolate, 0))));
2015 CHECK(v8_str("10")->Equals(result->Get(v8::Integer::New(isolate, 1)))); 2015 CHECK(v8_str("1")->Equals(result->Get(v8::Integer::New(isolate, 1))));
2016 CHECK(v8_str("140000")->Equals(result->Get(v8::Integer::New(isolate, 2)))); 2016 CHECK(v8_str("5")->Equals(result->Get(v8::Integer::New(isolate, 2))));
2017 CHECK(v8_str("10")->Equals(result->Get(v8::Integer::New(isolate, 3))));
2018 CHECK(v8_str("140000")->Equals(result->Get(v8::Integer::New(isolate, 4))));
2017 CHECK( 2019 CHECK(
2018 v8_str("4294967294")->Equals(result->Get(v8::Integer::New(isolate, 3)))); 2020 v8_str("4294967294")->Equals(result->Get(v8::Integer::New(isolate, 5))));
2019 // Indexed interceptor properties in the order they are returned
2020 // from the enumerator interceptor.
2021 CHECK(v8_str("0")->Equals(result->Get(v8::Integer::New(isolate, 4))));
2022 CHECK(v8_str("1")->Equals(result->Get(v8::Integer::New(isolate, 5))));
2023 // Named properties in insertion order. 2021 // Named properties in insertion order.
2024 CHECK(v8_str("a")->Equals(result->Get(v8::Integer::New(isolate, 6)))); 2022 CHECK(v8_str("a")->Equals(result->Get(v8::Integer::New(isolate, 6))));
2025 CHECK(v8_str("b")->Equals(result->Get(v8::Integer::New(isolate, 7)))); 2023 CHECK(v8_str("b")->Equals(result->Get(v8::Integer::New(isolate, 7))));
2026 CHECK(v8_str("c")->Equals(result->Get(v8::Integer::New(isolate, 8)))); 2024 CHECK(v8_str("c")->Equals(result->Get(v8::Integer::New(isolate, 8))));
2027 CHECK( 2025 CHECK(
2028 v8_str("4294967295")->Equals(result->Get(v8::Integer::New(isolate, 9)))); 2026 v8_str("4294967295")->Equals(result->Get(v8::Integer::New(isolate, 9))));
2029 CHECK(v8_str("d")->Equals(result->Get(v8::Integer::New(isolate, 10)))); 2027 CHECK(v8_str("d")->Equals(result->Get(v8::Integer::New(isolate, 10))));
2030 CHECK(v8_str("e")->Equals(result->Get(v8::Integer::New(isolate, 11)))); 2028 CHECK(v8_str("e")->Equals(result->Get(v8::Integer::New(isolate, 11))));
2031 CHECK(v8_str("30000000000") 2029 CHECK(v8_str("30000000000")
2032 ->Equals(result->Get(v8::Integer::New(isolate, 12)))); 2030 ->Equals(result->Get(v8::Integer::New(isolate, 12))));
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 "var obj = intercepted_1;" 3281 "var obj = intercepted_1;"
3284 "obj.x = 4;" 3282 "obj.x = 4;"
3285 "eval('obj.x');" 3283 "eval('obj.x');"
3286 "eval('obj.x');" 3284 "eval('obj.x');"
3287 "eval('obj.x');" 3285 "eval('obj.x');"
3288 "obj = intercepted_2;" 3286 "obj = intercepted_2;"
3289 "obj.x = 9;" 3287 "obj.x = 9;"
3290 "eval('obj.x');", 3288 "eval('obj.x');",
3291 9); 3289 9);
3292 } 3290 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698