OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |