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

Side by Side Diff: runtime/lib/uri.cc

Issue 23686021: Add property base to the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 years, 3 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/lib/uri_patch.dart » ('j') | runtime/vm/bootstrap_natives.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/directory.h"
6 #include "bin/utils.h"
5 #include "vm/bootstrap_natives.h" 7 #include "vm/bootstrap_natives.h"
6 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
7 #include "vm/object.h" 9 #include "vm/object.h"
8 10
9 namespace dart { 11 namespace dart {
10 12
11 DEFINE_NATIVE_ENTRY(Uri_isWindowsPlatform, 0) { 13 DEFINE_NATIVE_ENTRY(Uri_isWindowsPlatform, 0) {
12 #if defined(_WIN32) 14 #if defined(TARGET_OS_WINDOWS)
13 return Bool::True().raw(); 15 return Bool::True().raw();
14 #else 16 #else
15 return Bool::False().raw(); 17 return Bool::False().raw();
16 #endif 18 #endif
17 } 19 }
18 20
21
22 DEFINE_NATIVE_ENTRY(Uri_currentDirectory, 0) {
23 char* current = bin::Directory::Current();
24 if (current == NULL) {
25 bin::OSError err;
26 const String& error = String::Handle(String::NewFormatted(
27 "Error determining current directory: %s", err.message()));
28 const Array& args = Array::Handle(Array::New(1));
29 args.SetAt(0, error);
30 Exceptions::ThrowByType(Exceptions::kUnsupported, args);
31 }
32
33 const String& result = String::Handle(String::New(current));
34 return result.raw();
35 }
36
19 } // namespace dart 37 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/uri_patch.dart » ('j') | runtime/vm/bootstrap_natives.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698