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

Side by Side Diff: runtime/vm/dart_api_impl_test.cc

Issue 22685007: Implement updated method overriding rules in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/intermediate_language.h » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/builtin.h" 5 #include "bin/builtin.h"
6 #include "include/dart_api.h" 6 #include "include/dart_api.h"
7 #include "include/dart_mirrors_api.h" 7 #include "include/dart_mirrors_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/json.h" 10 #include "platform/json.h"
(...skipping 5284 matching lines...) Expand 10 before | Expand all | Expand 10 after
5295 } 5295 }
5296 5296
5297 5297
5298 TEST_CASE(ParsePatchLibrary) { 5298 TEST_CASE(ParsePatchLibrary) {
5299 const char* kLibraryChars = 5299 const char* kLibraryChars =
5300 "library patched_library;\n" 5300 "library patched_library;\n"
5301 "class A {\n" 5301 "class A {\n"
5302 " final fvalue;\n" 5302 " final fvalue;\n"
5303 " var _f;\n" 5303 " var _f;\n"
5304 " callFunc(x, y) => x(y);\n" 5304 " callFunc(x, y) => x(y);\n"
5305 " external method(var value);\n" 5305 " external void method(var value);\n"
5306 " get field => _field;\n" 5306 " get field => _field;\n"
5307 "}\n" 5307 "}\n"
5308 "class B {\n" 5308 "class B {\n"
5309 " var val;\n" 5309 " var val;\n"
5310 " external B.named(x);\n" 5310 " external B.named(x);\n"
5311 " external B(v);\n" 5311 " external B(v);\n"
5312 "}\n" 5312 "}\n"
5313 "external int unpatched();\n" 5313 "external int unpatched();\n"
5314 "external int topLevel(var value);\n" 5314 "external int topLevel(var value);\n"
5315 "external int get topLevelGetter;\n" 5315 "external int get topLevelGetter;\n"
5316 "external void set topLevelSetter(int value);\n"; 5316 "external void set topLevelSetter(int value);\n";
5317 5317
5318 const char* kPatchChars = 5318 const char* kPatchChars =
5319 "patch class A {\n" 5319 "patch class A {\n"
5320 " var _g;\n" 5320 " var _g;\n"
5321 " A() : fvalue = 13;\n" 5321 " A() : fvalue = 13;\n"
5322 " get _field => _g;\n" 5322 " get _field => _g;\n"
5323 " patch method(var value) {\n" 5323 " /*patch*/ void method(var value) {\n"
5324 " int closeYourEyes(var eggs) { return eggs * -1; }\n" 5324 " int closeYourEyes(var eggs) { return eggs * -1; }\n"
5325 " value = callFunc(closeYourEyes, value);\n" 5325 " value = callFunc(closeYourEyes, value);\n"
5326 " _g = value * 5;\n" 5326 " _g = value * 5;\n"
5327 " }\n" 5327 " }\n"
5328 "}\n" 5328 "}\n"
5329 "patch class B {\n" 5329 "patch class B {\n"
5330 " B._internal(x) : val = x;\n" 5330 " B._internal(x) : val = x;\n"
5331 " /*patch*/ factory B.named(x) { return new B._internal(x); }\n" 5331 " /*patch*/ factory B.named(x) { return new B._internal(x); }\n"
5332 " /*patch*/ factory B(v) native \"const_B_factory\";\n" 5332 " /*patch*/ factory B(v) native \"const_B_factory\";\n"
5333 "}\n" 5333 "}\n"
(...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after
7252 NewString("main"), 7252 NewString("main"),
7253 0, 7253 0,
7254 NULL); 7254 NULL);
7255 int64_t value = 0; 7255 int64_t value = 0;
7256 result = Dart_IntegerToInt64(result, &value); 7256 result = Dart_IntegerToInt64(result, &value);
7257 EXPECT_VALID(result); 7257 EXPECT_VALID(result);
7258 EXPECT_EQ(8, value); 7258 EXPECT_EQ(8, value);
7259 } 7259 }
7260 7260
7261 } // namespace dart 7261 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698