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

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

Issue 108083005: ES6: Add Object.getOwnPropertySymbols (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Do the filtering in the runtime function Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 9929 matching lines...) Expand 10 before | Expand all | Expand 10 after
9940 Local<v8::Object> o4 = t4->GetFunction()->NewInstance(); 9940 Local<v8::Object> o4 = t4->GetFunction()->NewInstance();
9941 9941
9942 // Create prototype chain of hidden prototypes. 9942 // Create prototype chain of hidden prototypes.
9943 CHECK(o4->SetPrototype(o3)); 9943 CHECK(o4->SetPrototype(o3));
9944 CHECK(o3->SetPrototype(o2)); 9944 CHECK(o3->SetPrototype(o2));
9945 CHECK(o2->SetPrototype(o1)); 9945 CHECK(o2->SetPrototype(o1));
9946 9946
9947 // Call the runtime version of GetLocalPropertyNames() on the natively 9947 // Call the runtime version of GetLocalPropertyNames() on the natively
9948 // created object through JavaScript. 9948 // created object through JavaScript.
9949 context->Global()->Set(v8_str("obj"), o4); 9949 context->Global()->Set(v8_str("obj"), o4);
9950 CompileRun("var names = %GetLocalPropertyNames(obj, true);"); 9950 // PROPERTY_KEY_STRING | PROPERTY_KEY_SYMBOL
9951 CompileRun("var names = %GetLocalPropertyNames(obj, 3);");
9951 9952
9952 ExpectInt32("names.length", 1006); 9953 ExpectInt32("names.length", 1006);
9953 ExpectTrue("names.indexOf(\"baz\") >= 0"); 9954 ExpectTrue("names.indexOf(\"baz\") >= 0");
9954 ExpectTrue("names.indexOf(\"boo\") >= 0"); 9955 ExpectTrue("names.indexOf(\"boo\") >= 0");
9955 ExpectTrue("names.indexOf(\"foo\") >= 0"); 9956 ExpectTrue("names.indexOf(\"foo\") >= 0");
9956 ExpectTrue("names.indexOf(\"fuz1\") >= 0"); 9957 ExpectTrue("names.indexOf(\"fuz1\") >= 0");
9957 ExpectTrue("names.indexOf(\"fuz2\") >= 0"); 9958 ExpectTrue("names.indexOf(\"fuz2\") >= 0");
9958 ExpectFalse("names[1005] == undefined"); 9959 ExpectFalse("names[1005] == undefined");
9959 } 9960 }
9960 9961
(...skipping 10738 matching lines...) Expand 10 before | Expand all | Expand 10 after
20699 CheckCorrectThrow("%GetProperty(other, 'x')"); 20700 CheckCorrectThrow("%GetProperty(other, 'x')");
20700 CheckCorrectThrow("%SetProperty(other, 'x', 'foo', 1, 0)"); 20701 CheckCorrectThrow("%SetProperty(other, 'x', 'foo', 1, 0)");
20701 CheckCorrectThrow("%IgnoreAttributesAndSetProperty(other, 'x', 'foo')"); 20702 CheckCorrectThrow("%IgnoreAttributesAndSetProperty(other, 'x', 'foo')");
20702 CheckCorrectThrow("%DeleteProperty(other, 'x', 0)"); 20703 CheckCorrectThrow("%DeleteProperty(other, 'x', 0)");
20703 CheckCorrectThrow("%DeleteProperty(other, '1', 0)"); 20704 CheckCorrectThrow("%DeleteProperty(other, '1', 0)");
20704 CheckCorrectThrow("%HasLocalProperty(other, 'x')"); 20705 CheckCorrectThrow("%HasLocalProperty(other, 'x')");
20705 CheckCorrectThrow("%HasProperty(other, 'x')"); 20706 CheckCorrectThrow("%HasProperty(other, 'x')");
20706 CheckCorrectThrow("%HasElement(other, 1)"); 20707 CheckCorrectThrow("%HasElement(other, 1)");
20707 CheckCorrectThrow("%IsPropertyEnumerable(other, 'x')"); 20708 CheckCorrectThrow("%IsPropertyEnumerable(other, 'x')");
20708 CheckCorrectThrow("%GetPropertyNames(other)"); 20709 CheckCorrectThrow("%GetPropertyNames(other)");
20709 CheckCorrectThrow("%GetLocalPropertyNames(other, true)"); 20710 // PROPERTY_KEY_STRING | PROPERTY_KEY_SYMBOL
20711 CheckCorrectThrow("%GetLocalPropertyNames(other, 3)");
20710 CheckCorrectThrow("%DefineOrRedefineAccessorProperty(" 20712 CheckCorrectThrow("%DefineOrRedefineAccessorProperty("
20711 "other, 'x', null, null, 1)"); 20713 "other, 'x', null, null, 1)");
20712 20714
20713 // Reset the failed access check callback so it does not influence 20715 // Reset the failed access check callback so it does not influence
20714 // the other tests. 20716 // the other tests.
20715 v8::V8::SetFailedAccessCheckCallbackFunction(NULL); 20717 v8::V8::SetFailedAccessCheckCallbackFunction(NULL);
20716 } 20718 }
20717 20719
20718 20720
20719 THREADED_TEST(Regress256330) { 20721 THREADED_TEST(Regress256330) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
20874 } 20876 }
20875 for (int i = 0; i < runs; i++) { 20877 for (int i = 0; i < runs; i++) {
20876 Local<String> expected; 20878 Local<String> expected;
20877 if (i != 0) { 20879 if (i != 0) {
20878 CHECK_EQ(v8_str("escape value"), values[i]); 20880 CHECK_EQ(v8_str("escape value"), values[i]);
20879 } else { 20881 } else {
20880 CHECK(values[i].IsEmpty()); 20882 CHECK(values[i].IsEmpty());
20881 } 20883 }
20882 } 20884 }
20883 } 20885 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698