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

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

Issue 787763005: Ensure class prototype objects have the right Map::constructor field (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/regress/regress-3750.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 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 24612 matching lines...) Expand 10 before | Expand all | Expand 10 after
24623 24623
24624 v8::Handle<v8::Value> result = CompileRun("%_GetPrototype(object)"); 24624 v8::Handle<v8::Value> result = CompileRun("%_GetPrototype(object)");
24625 CHECK(result->Equals(proto2)); 24625 CHECK(result->Equals(proto2));
24626 24626
24627 result = CompileRun( 24627 result = CompileRun(
24628 "function f() { return %_GetPrototype(object); }" 24628 "function f() { return %_GetPrototype(object); }"
24629 "%OptimizeFunctionOnNextCall(f);" 24629 "%OptimizeFunctionOnNextCall(f);"
24630 "f()"); 24630 "f()");
24631 CHECK(result->Equals(proto2)); 24631 CHECK(result->Equals(proto2));
24632 } 24632 }
24633
24634
24635 TEST(ClassPrototypeCreationContext) {
24636 i::FLAG_harmony_classes = true;
24637 v8::Isolate* isolate = CcTest::isolate();
24638 v8::HandleScope handle_scope(isolate);
24639 LocalContext env;
24640
24641 Handle<Object> result = Handle<Object>::Cast(
24642 CompileRun("'use strict'; class Example { }; Example.prototype"));
24643 CHECK(env.local() == result->CreationContext());
24644 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/regress/regress-3750.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698