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

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

Issue 1062523002: Use evaluate:source as the uri of eval scripts instead of the empty string, so e.g., package:stack… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « no previous file | runtime/vm/symbols.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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2799 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 } 2810 }
2811 2811
2812 2812
2813 static RawFunction* EvaluateHelper(const Class& cls, 2813 static RawFunction* EvaluateHelper(const Class& cls,
2814 const String& expr, 2814 const String& expr,
2815 const Array& param_names, 2815 const Array& param_names,
2816 bool is_static) { 2816 bool is_static) {
2817 const String& func_src = 2817 const String& func_src =
2818 String::Handle(BuildClosureSource(param_names, expr)); 2818 String::Handle(BuildClosureSource(param_names, expr));
2819 Script& script = Script::Handle(); 2819 Script& script = Script::Handle();
2820 script = Script::New(Symbols::Empty(), func_src, RawScript::kSourceTag); 2820 script = Script::New(Symbols::EvalSourceUri(),
2821 func_src,
2822 RawScript::kSourceTag);
2821 // In order to tokenize the source, we need to get the key to mangle 2823 // In order to tokenize the source, we need to get the key to mangle
2822 // private names from the library from which the class originates. 2824 // private names from the library from which the class originates.
2823 const Library& lib = Library::Handle(cls.library()); 2825 const Library& lib = Library::Handle(cls.library());
2824 ASSERT(!lib.IsNull()); 2826 ASSERT(!lib.IsNull());
2825 const String& lib_key = String::Handle(lib.private_key()); 2827 const String& lib_key = String::Handle(lib.private_key());
2826 script.Tokenize(lib_key); 2828 script.Tokenize(lib_key);
2827 2829
2828 const Function& func = Function::Handle( 2830 const Function& func = Function::Handle(
2829 Function::NewEvalFunction(cls, script, is_static)); 2831 Function::NewEvalFunction(cls, script, is_static));
2830 func.set_result_type(Type::Handle(Type::DynamicType())); 2832 func.set_result_type(Type::Handle(Type::DynamicType()));
(...skipping 17884 matching lines...) Expand 10 before | Expand all | Expand 10 after
20715 return tag_label.ToCString(); 20717 return tag_label.ToCString();
20716 } 20718 }
20717 20719
20718 20720
20719 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20721 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20720 Instance::PrintJSONImpl(stream, ref); 20722 Instance::PrintJSONImpl(stream, ref);
20721 } 20723 }
20722 20724
20723 20725
20724 } // namespace dart 20726 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698