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

Unified Diff: tools/gn/function_write_file.cc

Issue 1155713006: GN: Make file/dir resolving return errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/function_rebase_path.cc ('k') | tools/gn/functions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_write_file.cc
diff --git a/tools/gn/function_write_file.cc b/tools/gn/function_write_file.cc
index 9f853f87008769695c24495a6df2eff469e0245b..8a6fee31e1c93b01269d99bdf1917c5d2b956369 100644
--- a/tools/gn/function_write_file.cc
+++ b/tools/gn/function_write_file.cc
@@ -100,11 +100,11 @@ Value RunWriteFile(Scope* scope,
}
// Compute the file name and make sure it's in the output dir.
- if (!args[0].VerifyTypeIs(Value::STRING, err))
- return Value();
const SourceDir& cur_dir = scope->GetSourceDir();
- SourceFile source_file = cur_dir.ResolveRelativeFile(args[0].string_value(),
+ SourceFile source_file = cur_dir.ResolveRelativeFile(args[0], err,
scope->settings()->build_settings()->root_path_utf8());
+ if (err->has_error())
+ return Value();
if (!EnsureStringIsInOutputDir(
scope->settings()->build_settings()->build_dir(),
source_file.value(), args[0].origin(), err))
« no previous file with comments | « tools/gn/function_rebase_path.cc ('k') | tools/gn/functions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698