From e8d7e65fb9b537c6b50c31b4cd0f419aa897df4c Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 6 Sep 2015 16:26:50 +0900 Subject: [PATCH] Fix `Reflect.defineProperty` on edge v0.12 --- es6-shim.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/es6-shim.js b/es6-shim.js index f16d4857..339ac336 100644 --- a/es6-shim.js +++ b/es6-shim.js @@ -3184,9 +3184,11 @@ } } if (globals.Reflect.defineProperty) { - if (valueOrFalseIfThrows(function () { - globals.Reflect.defineProperty(1, 'test', { value: 1 }); - return true; + if (!valueOrFalseIfThrows(function () { + var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 }); + // "extensible" fails on Edge 0.12 + var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {}); + return basic && extensible; })) { overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty); }