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

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

Issue 14652008: Fix error reporting when calling static methods and closures withh mismatched arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/code_generator.cc ('k') | runtime/vm/flow_graph_builder.cc » ('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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "platform/json.h" 7 #include "platform/json.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 5905 matching lines...) Expand 10 before | Expand all | Expand 10 after
5916 Dart_Handle script_url = NewString("theScript"); 5916 Dart_Handle script_url = NewString("theScript");
5917 source = NewString(kScriptChars); 5917 source = NewString(kScriptChars);
5918 Dart_Handle test_script = Dart_LoadScript(script_url, source, 0, 0); 5918 Dart_Handle test_script = Dart_LoadScript(script_url, source, 0, 0);
5919 EXPECT_VALID(test_script); 5919 EXPECT_VALID(test_script);
5920 5920
5921 // Make sure that we can compile all of the patched code. 5921 // Make sure that we can compile all of the patched code.
5922 result = Dart_CompileAll(); 5922 result = Dart_CompileAll();
5923 EXPECT_VALID(result); 5923 EXPECT_VALID(result);
5924 5924
5925 result = Dart_Invoke(test_script, NewString("e1"), 0, NULL); 5925 result = Dart_Invoke(test_script, NewString("e1"), 0, NULL);
5926 EXPECT_ERROR(result, "method not found: 'unpatched'"); 5926 EXPECT_ERROR(result, "No top-level method 'unpatched'");
5927 5927
5928 int64_t value = 0; 5928 int64_t value = 0;
5929 result = Dart_Invoke(test_script, NewString("m1"), 0, NULL); 5929 result = Dart_Invoke(test_script, NewString("m1"), 0, NULL);
5930 EXPECT_VALID(result); 5930 EXPECT_VALID(result);
5931 EXPECT(Dart_IsInteger(result)); 5931 EXPECT(Dart_IsInteger(result));
5932 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); 5932 EXPECT_VALID(Dart_IntegerToInt64(result, &value));
5933 EXPECT_EQ(4, value); 5933 EXPECT_EQ(4, value);
5934 5934
5935 value = 0; 5935 value = 0;
5936 result = Dart_Invoke(test_script, NewString("m2"), 0, NULL); 5936 result = Dart_Invoke(test_script, NewString("m2"), 0, NULL);
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after
7610 NewString("main"), 7610 NewString("main"),
7611 0, 7611 0,
7612 NULL); 7612 NULL);
7613 int64_t value = 0; 7613 int64_t value = 0;
7614 result = Dart_IntegerToInt64(result, &value); 7614 result = Dart_IntegerToInt64(result, &value);
7615 EXPECT_VALID(result); 7615 EXPECT_VALID(result);
7616 EXPECT_EQ(260, value); 7616 EXPECT_EQ(260, value);
7617 } 7617 }
7618 7618
7619 } // namespace dart 7619 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698