From 9e1212f6bab068b0a3ac007258b5340e35ee3672 Mon Sep 17 00:00:00 2001 From: Ben Thompson Date: Thu, 25 Feb 2016 17:51:07 -0500 Subject: [PATCH] Fixes #173. Symbol()'s call to Object.defineProperty() accessor descriptor should set a default 'get' property when adding a 'set' property. Prevents crash in old Qt Script engine (WebKit). --- library/modules/es6.symbol.js | 1 + modules/es6.symbol.js | 1 + 2 files changed, 2 insertions(+) diff --git a/library/modules/es6.symbol.js b/library/modules/es6.symbol.js index 45c47aa807b8..b1eb469872e0 100644 --- a/library/modules/es6.symbol.js +++ b/library/modules/es6.symbol.js @@ -54,6 +54,7 @@ var wrap = function(tag){ sym._k = tag; DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, { configurable: true, + get: tag, set: function(value){ if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); diff --git a/modules/es6.symbol.js b/modules/es6.symbol.js index 45c47aa807b8..b1eb469872e0 100644 --- a/modules/es6.symbol.js +++ b/modules/es6.symbol.js @@ -54,6 +54,7 @@ var wrap = function(tag){ sym._k = tag; DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, { configurable: true, + get: tag, set: function(value){ if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value));