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

Side by Side Diff: test/cctest/test-unscopables-hidden-prototype.cc

Issue 455763002: Unship unscopables and disable array.values iterators (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adjust BUILD.gn Created 6 years, 4 months 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
« no previous file with comments | « src/unscopables.js ('k') | test/mjsunit/es6/array-iterator.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "src/v8.h" 7 #include "src/v8.h"
8 #include "test/cctest/cctest.h" 8 #include "test/cctest/cctest.h"
9 9
10 namespace { 10 namespace {
11 11
12 12
13 static void Cleanup() { 13 static void Cleanup() {
14 CompileRun( 14 CompileRun(
15 "delete object.x;" 15 "delete object.x;"
16 "delete hidden_prototype.x;" 16 "delete hidden_prototype.x;"
17 "delete object[Symbol.unscopables];" 17 "delete object[Symbol.unscopables];"
18 "delete hidden_prototype[Symbol.unscopables];"); 18 "delete hidden_prototype[Symbol.unscopables];");
19 } 19 }
20 20
21 21
22 TEST(Unscopables) { 22 TEST(Unscopables) {
23 i::FLAG_harmony_unscopables = true;
24
23 LocalContext context; 25 LocalContext context;
24 v8::Isolate* isolate = context->GetIsolate(); 26 v8::Isolate* isolate = context->GetIsolate();
25 v8::HandleScope handle_scope(isolate); 27 v8::HandleScope handle_scope(isolate);
26 28
27 v8::Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate); 29 v8::Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate);
28 v8::Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); 30 v8::Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate);
29 31
30 t1->SetHiddenPrototype(true); 32 t1->SetHiddenPrototype(true);
31 33
32 v8::Local<v8::Object> object = t0->GetFunction()->NewInstance(); 34 v8::Local<v8::Object> object = t0->GetFunction()->NewInstance();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 "var result;" 96 "var result;"
95 "var x = 0;" 97 "var x = 0;"
96 "hidden_prototype.x = 6;" 98 "hidden_prototype.x = 6;"
97 "object[Symbol.unscopables] = {x: true};" 99 "object[Symbol.unscopables] = {x: true};"
98 "with (object) {" 100 "with (object) {"
99 " result = x;" 101 " result = x;"
100 "}" 102 "}"
101 "result")->Int32Value()); 103 "result")->Int32Value());
102 } 104 }
103 } 105 }
OLDNEW
« no previous file with comments | « src/unscopables.js ('k') | test/mjsunit/es6/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698