From 19c7086200b72f896e112dc6ecf9596ab9366766 Mon Sep 17 00:00:00 2001 From: Stan Kardach Date: Sun, 11 May 2014 16:59:33 +0200 Subject: [PATCH 1/2] Fix #2152: Cast opened paths to string path.resolve() was throwing an exception if given path was not a string. When iterating through all given paths, each entry is casted by JS to most suitable type and paths in form of a number (i.e. '1234') were cast to Number, hence the bug. --- src/browser/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 99b9b54c3..e742e88d6 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -42,7 +42,7 @@ start = -> app.removeListener 'open-url', addUrlToOpen args.pathsToOpen = args.pathsToOpen.map (pathToOpen) -> - path.resolve(args.executedFrom ? process.cwd(), pathToOpen) + path.resolve(args.executedFrom ? process.cwd(), "#{pathToOpen}") require('coffee-script').register() if args.devMode From b4cb92af99fb4c6d2096adfd7ccdfdbaa9399303 Mon Sep 17 00:00:00 2001 From: Stan Kardach Date: Sun, 11 May 2014 16:59:33 +0200 Subject: [PATCH 2/2] Fix #2152: Cast opened paths to string path.resolve() was throwing an exception if given path was not a string. When iterating through all given paths, each entry is casted by JS to most suitable type and paths in form of a number (i.e. '1234') were cast to Number, hence the bug. --- src/browser/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/main.coffee b/src/browser/main.coffee index e742e88d6..254fabb20 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -42,7 +42,7 @@ start = -> app.removeListener 'open-url', addUrlToOpen args.pathsToOpen = args.pathsToOpen.map (pathToOpen) -> - path.resolve(args.executedFrom ? process.cwd(), "#{pathToOpen}") + path.resolve(args.executedFrom ? process.cwd(), pathToOpen.toString()) require('coffee-script').register() if args.devMode