From 00e45c0d3c3f5b2913e32dc05bfbea366fb894ff Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 13 Jul 2016 15:36:34 -0400 Subject: [PATCH] FIX: Safari strict mode errors --- .../discourse/lib/raw-handlebars.js.es6 | 91 +++++++++---------- .../engines/discourse-markdown.js.es6 | 2 +- .../engines/discourse-markdown/bbcode.js.es6 | 64 +++++++------ 3 files changed, 84 insertions(+), 73 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/raw-handlebars.js.es6 b/app/assets/javascripts/discourse/lib/raw-handlebars.js.es6 index e33c912009b..423d8e88352 100644 --- a/app/assets/javascripts/discourse/lib/raw-handlebars.js.es6 +++ b/app/assets/javascripts/discourse/lib/raw-handlebars.js.es6 @@ -14,7 +14,7 @@ const RawHandlebars = Handlebars.create(); RawHandlebars.helper = function() {}; RawHandlebars.helpers = objectCreate(Handlebars.helpers); -RawHandlebars.helpers.get = function(context, options){ +RawHandlebars.helpers['get'] = function(context, options) { var firstContext = options.contexts[0]; var val = firstContext[context]; @@ -38,7 +38,7 @@ function stringCompatHelper(fn) { RawHandlebars.registerHelper('each', function(localName,inKeyword,contextName,options){ var list = Em.get(this, contextName); var output = []; - var innerContext = Object.create(this); + var innerContext = objectCreate(this); for (var i=0; i ['span', {'class': 'bbcode-b'}].concat(contents)); replaceBBCode('i', contents => ['span', {'class': 'bbcode-i'}].concat(contents));