mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't make prepareStackTrace unwritable
This breaks other code (such as Grim) that may want to temporarily use a different prepareStackTrace function.
This commit is contained in:
@@ -20,7 +20,13 @@ exports.getCachePath = function(sourceCode) {
|
||||
|
||||
exports.compile = function(sourceCode, filePath) {
|
||||
if (!CoffeeScript) {
|
||||
var previousPrepareStackTrace = Error.prepareStackTrace
|
||||
CoffeeScript = require('coffee-script')
|
||||
|
||||
// When it loads, coffee-script reassigns Error.prepareStackTrace. We have
|
||||
// already reassigned it via the 'source-map-support' module, so we need
|
||||
// to set it back.
|
||||
Error.prepareStackTrace = previousPrepareStackTrace
|
||||
}
|
||||
|
||||
var output = CoffeeScript.compile(sourceCode, {
|
||||
|
||||
@@ -138,15 +138,6 @@ require('source-map-support').install({
|
||||
}
|
||||
})
|
||||
|
||||
// This prevents coffee-script from reassigning `Error.prepareStackTrace` when
|
||||
// it is loaded.
|
||||
Object.defineProperty(Error, 'prepareStackTrace', {
|
||||
value: Error.prepareStackTrace,
|
||||
configurable: false,
|
||||
enumerable: true,
|
||||
writable: false
|
||||
})
|
||||
|
||||
Object.keys(COMPILERS).forEach(function (extension) {
|
||||
var compiler = COMPILERS[extension]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user