From 0bbbd5ec3fdd6da44a6e340f6ee9004804a33858 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Sun, 17 May 2015 23:01:20 +0200 Subject: [PATCH] Fix invalid method syntax used in URL constructor --- lib/sdk/url.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/sdk/url.js b/lib/sdk/url.js index 7bcf00e54..95f0ff5dc 100644 --- a/lib/sdk/url.js +++ b/lib/sdk/url.js @@ -152,20 +152,28 @@ function URL(url, base) { Object.defineProperties(this, { toString: { - value() new String(uri.spec).toString(), + value() { + return new String(uri.spec).toString(); + }, enumerable: false }, valueOf: { - value() new String(uri.spec).valueOf(), + value() { + return new String(uri.spec).valueOf(); + }, enumerable: false }, toSource: { - value() new String(uri.spec).toSource(), + value() { + return new String(uri.spec).toSource(); + }, enumerable: false }, // makes more sense to flatten to string, easier to travel across JSON toJSON: { - value() new String(uri.spec).toString(), + value() { + return new String(uri.spec).toString(); + }, enumerable: false } });