From 3785996c44e4634d75a2a58dc72c4d91653615ca Mon Sep 17 00:00:00 2001 From: Alex Gorbatchev Date: Thu, 13 Jun 2013 13:50:05 -0700 Subject: [PATCH] Made stack patch test less brittle. --- src/coffee-script.coffee | 2 +- test/error_messages.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index b35f82be..b6c1e077 100644 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -100,7 +100,7 @@ exports.run = (code, options = {}) -> # Compile. if not helpers.isCoffee(mainModule.filename) or require.extensions answer = compile code, options - code = answer.js? and answer.js or answer + code = answer.js ? answer mainModule._compile code, mainModule.filename diff --git a/test/error_messages.coffee b/test/error_messages.coffee index b61f9b71..1741b613 100644 --- a/test/error_messages.coffee +++ b/test/error_messages.coffee @@ -45,7 +45,7 @@ test "compiler error formatting", -> test "patchStackTrace line patching", -> err = new Error 'error' - ok err.stack.indexOf('test/error_messages.coffee:47:4') >= 0 # should be fixed to the correct line if more lines added to this file + ok err.stack.match /test\/error_messages\.coffee:\d+:\d+\b/ fs = require 'fs'