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

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

Issue 10163003: Put new global var semantics behind a flag until WebKit tests are cleaned up. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments (and oops, rebased too early). Created 8 years, 8 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 | « test/cctest/test-api.cc ('k') | test/mjsunit/declare-locally.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 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 514 }
515 515
516 // Use the prototype as the holder for the interceptors. 516 // Use the prototype as the holder for the interceptors.
517 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) { 517 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) {
518 return function->PrototypeTemplate(); 518 return function->PrototypeTemplate();
519 } 519 }
520 }; 520 };
521 521
522 522
523 TEST(ExistsInPrototype) { 523 TEST(ExistsInPrototype) {
524 i::FLAG_es52_globals = true;
524 HandleScope scope; 525 HandleScope scope;
525 526
526 // Sanity check to make sure that the holder of the interceptor 527 // Sanity check to make sure that the holder of the interceptor
527 // really is the prototype object. 528 // really is the prototype object.
528 { ExistsInPrototypeContext context; 529 { ExistsInPrototypeContext context;
529 context.Check("this.x = 87; this.x", 530 context.Check("this.x = 87; this.x",
530 0, 531 0,
531 0, 532 0,
532 0, 533 0,
533 EXPECT_RESULT, Number::New(87)); 534 EXPECT_RESULT, Number::New(87));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 577 }
577 578
578 // Use the prototype as the holder for the interceptors. 579 // Use the prototype as the holder for the interceptors.
579 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) { 580 virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) {
580 return function->PrototypeTemplate(); 581 return function->PrototypeTemplate();
581 } 582 }
582 }; 583 };
583 584
584 585
585 TEST(AbsentInPrototype) { 586 TEST(AbsentInPrototype) {
587 i::FLAG_es52_globals = true;
586 HandleScope scope; 588 HandleScope scope;
587 589
588 { AbsentInPrototypeContext context; 590 { AbsentInPrototypeContext context;
589 context.Check("if (false) { var x = 0; }; x", 591 context.Check("if (false) { var x = 0; }; x",
590 0, 592 0,
591 0, 593 0,
592 0, // declaration 594 0, // declaration
593 EXPECT_RESULT, Undefined()); 595 EXPECT_RESULT, Undefined());
594 } 596 }
595 } 597 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/mjsunit/declare-locally.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698