OLD | NEW |
---|---|
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 5293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5304 "external int unpatched();\n" | 5304 "external int unpatched();\n" |
5305 "external int topLevel(var value);\n" | 5305 "external int topLevel(var value);\n" |
5306 "external int get topLevelGetter;\n" | 5306 "external int get topLevelGetter;\n" |
5307 "external void set topLevelSetter(int value);\n"; | 5307 "external void set topLevelSetter(int value);\n"; |
5308 | 5308 |
5309 const char* kPatchChars = | 5309 const char* kPatchChars = |
5310 "patch class A {\n" | 5310 "patch class A {\n" |
5311 " var _g;\n" | 5311 " var _g;\n" |
5312 " A() : fvalue = 13;\n" | 5312 " A() : fvalue = 13;\n" |
5313 " get _field => _g;\n" | 5313 " get _field => _g;\n" |
5314 " patch method(var value) {\n" | 5314 " /*patch*/ method(var value) {\n" |
siva
2013/08/12 02:56:43
void method(var value) {....
regis
2013/08/12 17:45:27
Done.
| |
5315 " int closeYourEyes(var eggs) { return eggs * -1; }\n" | 5315 " int closeYourEyes(var eggs) { return eggs * -1; }\n" |
5316 " value = callFunc(closeYourEyes, value);\n" | 5316 " value = callFunc(closeYourEyes, value);\n" |
5317 " _g = value * 5;\n" | 5317 " _g = value * 5;\n" |
5318 " }\n" | 5318 " }\n" |
5319 "}\n" | 5319 "}\n" |
5320 "patch class B {\n" | 5320 "patch class B {\n" |
5321 " B._internal(x) : val = x;\n" | 5321 " B._internal(x) : val = x;\n" |
5322 " /*patch*/ factory B.named(x) { return new B._internal(x); }\n" | 5322 " /*patch*/ factory B.named(x) { return new B._internal(x); }\n" |
5323 " /*patch*/ factory B(v) native \"const_B_factory\";\n" | 5323 " /*patch*/ factory B(v) native \"const_B_factory\";\n" |
5324 "}\n" | 5324 "}\n" |
(...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7243 NewString("main"), | 7243 NewString("main"), |
7244 0, | 7244 0, |
7245 NULL); | 7245 NULL); |
7246 int64_t value = 0; | 7246 int64_t value = 0; |
7247 result = Dart_IntegerToInt64(result, &value); | 7247 result = Dart_IntegerToInt64(result, &value); |
7248 EXPECT_VALID(result); | 7248 EXPECT_VALID(result); |
7249 EXPECT_EQ(8, value); | 7249 EXPECT_EQ(8, value); |
7250 } | 7250 } |
7251 | 7251 |
7252 } // namespace dart | 7252 } // namespace dart |
OLD | NEW |