From a1cc699da262577ea796a2e169226bfc4bbb9473 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Mon, 29 Oct 2018 15:03:23 +0100 Subject: [PATCH 01/26] Revert "Revert "Fix Node.js 10 support (#1937)"" This reverts commit 5de2600133536b3841056e2c8959f516cf28412f. --- package-lock.json | 658 +++++++++++++++------------------ package.json | 2 +- src/js_class.hpp | 23 +- src/js_list.hpp | 56 +-- src/js_realm.hpp | 124 +++---- src/js_realm_object.hpp | 34 +- src/js_results.hpp | 70 ++-- src/js_sync.hpp | 168 ++++----- src/js_util.hpp | 2 +- src/jsc/jsc_class.hpp | 23 +- src/node/node_class.hpp | 79 ++-- src/node/node_return_value.hpp | 4 +- src/node/node_types.hpp | 18 +- src/rpc.cpp | 14 +- src/rpc.hpp | 2 +- 15 files changed, 600 insertions(+), 677 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd44961565..3b51dc0fed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "realm", - "version": "2.19.0-rc.1", + "version": "2.19.0-rc.4", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz", - "integrity": "sha1-KgJkM2jegJFhYr5whlyXd08629k=", + "resolved": "http://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz", + "integrity": "sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==", "dev": true, "requires": { "@babel/highlight": "7.0.0-beta.44" @@ -15,8 +15,8 @@ }, "@babel/generator": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz", - "integrity": "sha1-x+Z7m1KEr89pswm1DX038+UDPUI=", + "resolved": "http://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz", + "integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==", "dev": true, "requires": { "@babel/types": "7.0.0-beta.44", @@ -28,8 +28,8 @@ }, "@babel/helper-function-name": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", - "integrity": "sha1-4YVSqq4iMRAKbkheA4VLw1MtRN0=", + "resolved": "http://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", + "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==", "dev": true, "requires": { "@babel/helper-get-function-arity": "7.0.0-beta.44", @@ -39,8 +39,8 @@ }, "@babel/helper-get-function-arity": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", - "integrity": "sha1-0Dym3SufewseazLFbHKDYUDbOhU=", + "resolved": "http://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", + "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==", "dev": true, "requires": { "@babel/types": "7.0.0-beta.44" @@ -48,8 +48,8 @@ }, "@babel/helper-split-export-declaration": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", - "integrity": "sha1-wLNRc14PvLOCLIrY205YOwXr2dw=", + "resolved": "http://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", + "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==", "dev": true, "requires": { "@babel/types": "7.0.0-beta.44" @@ -57,8 +57,8 @@ }, "@babel/highlight": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz", - "integrity": "sha1-GMlM5UORaoBVPtzc9oGJCyAHR9U=", + "resolved": "http://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz", + "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -68,8 +68,8 @@ }, "@babel/template": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", - "integrity": "sha1-+IMvT9zuXVm/UV5ZX8UQbFKbOU8=", + "resolved": "http://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", + "integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==", "dev": true, "requires": { "@babel/code-frame": "7.0.0-beta.44", @@ -80,8 +80,8 @@ }, "@babel/traverse": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz", - "integrity": "sha1-qXCixFR3rRgBfi5GWgYG/u4NKWY=", + "resolved": "http://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz", + "integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==", "dev": true, "requires": { "@babel/code-frame": "7.0.0-beta.44", @@ -97,20 +97,26 @@ }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, "@babel/types": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz", - "integrity": "sha1-axsWRZH3fewKA0KsqZXy0Eazp1c=", + "resolved": "http://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz", + "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -142,40 +148,16 @@ "dev": true, "requires": { "acorn": "^5.0.3" - } - }, - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.1" }, "dependencies": { - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } } }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true - }, "ansi-escapes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", @@ -199,12 +181,12 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=" + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, "are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha1-SzXClE8GKov82mZBB2A1D+nd/CE=", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -213,7 +195,7 @@ "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -289,50 +271,12 @@ "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=" - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, "babel-eslint": { "version": "8.2.6", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz", - "integrity": "sha1-YnDQxzIFYoBnwPeuFpOp55es79k=", + "integrity": "sha512-aCdHjhzcILdP8c9lej7hvXKvQieyRt20SF102SIGyY4cUIiw6UaAtK4j2o3dXX74jEmy0TJ0CEhv4fTIM3SzcA==", "dev": true, "requires": { "@babel/code-frame": "7.0.0-beta.44", @@ -452,12 +396,6 @@ "supports-color": "^5.3.0" } }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "dev": true - }, "chownr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", @@ -466,7 +404,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "cli-cursor": { @@ -510,9 +448,9 @@ "dev": true }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "requires": { "delayed-stream": "~1.0.0" } @@ -563,7 +501,7 @@ "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha1-Sl7Hxk364iw6FBJNus3uhG2Ay8Q=", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { "nice-try": "^1.0.4", @@ -574,9 +512,9 @@ }, "dependencies": { "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true } } @@ -587,6 +525,13 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } } }, "debug": { @@ -753,7 +698,7 @@ "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha1-XNAfwQFiG0LEzX9dGmYkNxbT850=", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -822,16 +767,16 @@ "dev": true }, "eslint": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.3.0.tgz", - "integrity": "sha1-U2laylITloqs35cMyyMeQqKyhfg=", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", + "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", "dev": true, "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", - "debug": "^3.1.0", + "debug": "^4.0.1", "doctrine": "^2.1.0", "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", @@ -843,11 +788,11 @@ "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", - "ignore": "^4.0.2", + "ignore": "^4.0.6", "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", + "inquirer": "^6.1.0", "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", + "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.5", @@ -858,16 +803,47 @@ "path-is-inside": "^1.0.2", "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^2.0.0", + "regexpp": "^2.0.1", "require-uncached": "^1.0.3", - "semver": "^5.5.0", - "string.prototype.matchall": "^2.0.0", + "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^4.0.3", + "table": "^5.0.2", "text-table": "^0.2.0" }, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "ajv": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", + "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -875,39 +851,76 @@ "dev": true }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "eslint-scope": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha1-UL8wcekzi83EMzF5Sgy1M/ATYXI=", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -916,6 +929,18 @@ "requires": { "ansi-regex": "^3.0.0" } + }, + "table": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", + "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", + "dev": true, + "requires": { + "ajv": "^6.5.3", + "lodash": "^4.17.10", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + } } } }, @@ -968,9 +993,12 @@ }, "eslint-visitor-keys": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha1-PzGA+y4pEBdxastMnW1bXDSmqB0=", - "dev": true + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } }, "espree": { "version": "4.0.0", @@ -985,13 +1013,13 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha1-QGxRZYsfWZGl+bYrHcJbAOPlxwg=", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { "estraverse": "^4.0.0" @@ -1000,7 +1028,7 @@ "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { "estraverse": "^4.1.0" @@ -1021,18 +1049,7 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" - }, - "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha1-BFURz9jRM/OEZnPRBHwVTiFK09U=", - "dev": true, - "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - } + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extsprintf": { "version": "1.3.0", @@ -1156,7 +1173,6 @@ "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", "mime-types": "^2.1.12" } }, @@ -1173,7 +1189,7 @@ "fs-minipass": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha1-BsJ3IYRU7CiN93raVKA7hwKqy50=", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "requires": { "minipass": "^2.2.1" } @@ -1225,6 +1241,13 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } } }, "glob": { @@ -1306,27 +1329,12 @@ "function-bind": "^1.0.2" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -1420,21 +1428,21 @@ "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" }, "inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha1-2zUMK3Paynf/EkOWLp8i8JloVyY=", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", "chalk": "^2.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.1.0", + "external-editor": "^3.0.0", "figures": "^2.0.0", - "lodash": "^4.3.0", + "lodash": "^4.17.10", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^5.5.2", + "rxjs": "^6.1.0", "string-width": "^2.1.0", "strip-ansi": "^4.0.0", "through": "^2.3.6" @@ -1446,16 +1454,51 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -1482,7 +1525,7 @@ "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -1531,7 +1574,7 @@ "is-path-in-cwd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha1-WsSLNF72dTOb1sekipEhELJBz1I=", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "^1.0.0" @@ -1564,7 +1607,7 @@ "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha1-+xj4fOH+uSUWnJpAfBkxijIG7Yg=", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-stream": { @@ -1622,7 +1665,7 @@ "js-yaml": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha1-6u1lbsg0TxD1J8a/obbiJE3hZ9E=", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -1708,9 +1751,12 @@ }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } }, "json-stringify-safe": { "version": "5.0.1", @@ -1725,6 +1771,12 @@ "graceful-fs": "^4.1.6" } }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -1843,9 +1895,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha1-G3eTz3JZ6jj7NmHU04syYK+K5Oc=", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "loose-envify": { @@ -1870,17 +1922,19 @@ "integrity": "sha1-XUf3CcTJ/Dwha21GEnKA9As515A=", "dev": true }, - "mime-db": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", - "integrity": "sha1-BWnWV0ZkkSg3CWY603mpm5DZq0c=" - }, "mime-types": { - "version": "2.1.19", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", - "integrity": "sha1-ceRkU3p++BwV8tudl+kT/A/2BvA=", + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "requires": { - "mime-db": "~1.35.0" + "mime-db": "~1.37.0" + }, + "dependencies": { + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + } } }, "mimic-fn": { @@ -1927,9 +1981,9 @@ } }, "mkdirp": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", - "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" } @@ -1952,9 +2006,9 @@ "dev": true }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" }, "natural-compare": { "version": "1.4.0", @@ -1990,7 +2044,7 @@ "node-pre-gyp": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha1-2x8zIVJy9pLNOPAyOOPptHxd0FQ=", + "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -2002,16 +2056,6 @@ "rimraf": "^2.6.1", "semver": "^5.3.0", "tar": "^4" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - } - } } }, "nopt": { @@ -2038,12 +2082,12 @@ "npm-bundled": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha1-PBcyt7qTazoQMlrvYWRnwMy8yXk=" + "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" }, "npm-packlist": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz", - "integrity": "sha1-hOjGg8vnhn00sdNX2JPOKeKKAt4=", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.12.tgz", + "integrity": "sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" @@ -2052,7 +2096,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -2136,7 +2180,7 @@ "osenv": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha1-hc36+uso6Gd/QW4odZK18/SepBA=", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -2247,10 +2291,15 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" }, + "querystringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.0.0.tgz", + "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw==" + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha1-zZJL9SAKB1uDwYjNa54hG3/A0+0=", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -2260,7 +2309,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } @@ -2327,25 +2376,10 @@ "resolve": "^1.1.6" } }, - "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha1-azByTjBqJ4M+6xcbZqyIkLo35Bw=", - "dev": true, - "requires": { - "define-properties": "^1.1.2" - } - }, - "regexpp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz", - "integrity": "sha1-sqdTSoXKGwM7z1zp/45W1OB1U2U=", - "dev": true - }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -2455,15 +2489,6 @@ "is-promise": "^2.1.0" } }, - "rxjs": { - "version": "5.5.11", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz", - "integrity": "sha1-9zMCfKQ+O+xrmURzvkq5itQ87Yc=", - "dev": true, - "requires": { - "symbol-observable": "1.0.1" - } - }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -2622,6 +2647,13 @@ "jsbn": "~0.1.0", "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } } }, "stream-counter": { @@ -2639,40 +2671,6 @@ "strip-ansi": "^3.0.0" } }, - "string.prototype.matchall": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz", - "integrity": "sha1-Kvj+PS1txTyipZvTdrCJw8FSs8g=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.10.0", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "regexp.prototype.flags": "^1.2.0" - }, - "dependencies": { - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - } - } - }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", @@ -2683,7 +2681,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" @@ -2711,12 +2709,6 @@ "has-flag": "^3.0.0" } }, - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", - "dev": true - }, "sync-request": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-3.0.1.tgz", @@ -2727,53 +2719,6 @@ "then-request": "^2.0.1" } }, - "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha1-ALXitgLxeUuayvnKkIp2OGp4E7w=", - "dev": true, - "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "taffydb": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", @@ -2898,6 +2843,12 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -2976,7 +2927,7 @@ "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { "punycode": "^2.1.0" @@ -2985,7 +2936,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true } } @@ -2997,13 +2948,6 @@ "requires": { "querystringify": "^2.0.0", "requires-port": "^1.0.0" - }, - "dependencies": { - "querystringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.0.0.tgz", - "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw==" - } } }, "util-deprecate": { @@ -3020,7 +2964,7 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=" + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "validate-npm-package-license": { "version": "3.0.1", @@ -3040,6 +2984,13 @@ "assert-plus": "^1.0.0", "core-util-is": "1.0.2", "extsprintf": "^1.2.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } } }, "whatwg-fetch": { @@ -3059,7 +3010,7 @@ "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "requires": { "string-width": "^1.0.2 || 2" } @@ -3082,17 +3033,6 @@ "dev": true, "requires": { "mkdirp": "^0.5.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - } } }, "xmlcreate": { diff --git a/package.json b/package.json index 8431d5aacf..d2d96980d9 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "deepmerge": "2.1.0", "fs-extra": "^4.0.2", "ini": "^1.3.4", - "nan": "2.8.0", + "nan": "^2.10.0", "node-fetch": "^1.6.3", "node-pre-gyp": "^0.11.0", "progress": "^2.0.0", diff --git a/src/js_class.hpp b/src/js_class.hpp index 761838d5e6..b3fea74804 100644 --- a/src/js_class.hpp +++ b/src/js_class.hpp @@ -27,12 +27,6 @@ namespace realm { namespace js { -template -using ConstructorType = void(typename T::Context, typename T::Object, size_t, const typename T::Value[]); - -template -using MethodType = void(typename T::Context, typename T::Function, typename T::Object, size_t, const typename T::Value[], ReturnValue &); - template struct Arguments { const typename T::Context ctx; @@ -52,15 +46,24 @@ struct Arguments { } } - void validate_count(size_t actual) const { - if (count != actual) { - throw std::invalid_argument(util::format("Invalid arguments: %1 expected, but %s supplied.", actual, count)); + void validate_count(size_t expected) const { + if (count != expected) { + throw std::invalid_argument(util::format("Invalid arguments: %1 expected, but %2 supplied.", expected, count)); + } + } + + void validate_between(size_t min, size_t max) const { + if (count < min || count > max) { + throw std::invalid_argument(util::format("Invalid arguments: expected between %1 and %2, but %3 supplied.", min, max, count)); } } }; template -using ArgumentsMethodType = void(typename T::Context, typename T::Object, Arguments, ReturnValue &); +using ConstructorType = void(typename T::Context, typename T::Object, Arguments &); + +template +using ArgumentsMethodType = void(typename T::Context, typename T::Object, Arguments &, ReturnValue &); template struct PropertyType { diff --git a/src/js_list.hpp b/src/js_list.hpp index ae4af82f2a..def1de0376 100644 --- a/src/js_list.hpp +++ b/src/js_list.hpp @@ -65,22 +65,22 @@ struct ListClass : ClassDefinition, CollectionClass> { static bool set_index(ContextType, ObjectType, uint32_t, ValueType); // methods - static void push(ContextType, ObjectType, Arguments, ReturnValue &); - static void pop(ContextType, ObjectType, Arguments, ReturnValue &); - static void unshift(ContextType, ObjectType, Arguments, ReturnValue &); - static void shift(ContextType, ObjectType, Arguments, ReturnValue &); - static void splice(ContextType, ObjectType, Arguments, ReturnValue &); - static void snapshot(ContextType, ObjectType, Arguments, ReturnValue &); - static void filtered(ContextType, ObjectType, Arguments, ReturnValue &); - static void sorted(ContextType, ObjectType, Arguments, ReturnValue &); - static void is_valid(ContextType, ObjectType, Arguments, ReturnValue &); - static void is_empty(ContextType, ObjectType, Arguments, ReturnValue &); - static void index_of(ContextType, ObjectType, Arguments, ReturnValue &); + static void push(ContextType, ObjectType, Arguments &, ReturnValue &); + static void pop(ContextType, ObjectType, Arguments &, ReturnValue &); + static void unshift(ContextType, ObjectType, Arguments &, ReturnValue &); + static void shift(ContextType, ObjectType, Arguments &, ReturnValue &); + static void splice(ContextType, ObjectType, Arguments &, ReturnValue &); + static void snapshot(ContextType, ObjectType, Arguments &, ReturnValue &); + static void filtered(ContextType, ObjectType, Arguments &, ReturnValue &); + static void sorted(ContextType, ObjectType, Arguments &, ReturnValue &); + static void is_valid(ContextType, ObjectType, Arguments &, ReturnValue &); + static void is_empty(ContextType, ObjectType, Arguments &, ReturnValue &); + static void index_of(ContextType, ObjectType, Arguments &, ReturnValue &); // observable - static void add_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_all_listeners(ContextType, ObjectType, Arguments, ReturnValue &); + static void add_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_all_listeners(ContextType, ObjectType, Arguments &, ReturnValue &); std::string const name = "List"; @@ -157,7 +157,7 @@ bool ListClass::set_index(ContextType ctx, ObjectType object, uint32_t index, } template -void ListClass::push(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::push(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); for (size_t i = 0; i < args.count; i++) { validate_value(ctx, *list, args[i]); @@ -172,7 +172,7 @@ void ListClass::push(ContextType ctx, ObjectType this_object, Arguments args, } template -void ListClass::pop(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::pop(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto list = get_internal>(this_object); @@ -188,7 +188,7 @@ void ListClass::pop(ContextType ctx, ObjectType this_object, Arguments args, } template -void ListClass::unshift(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::unshift(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); for (size_t i = 0; i < args.count; i++) { validate_value(ctx, *list, args[i]); @@ -203,7 +203,7 @@ void ListClass::unshift(ContextType ctx, ObjectType this_object, Arguments ar } template -void ListClass::shift(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::shift(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto list = get_internal>(this_object); @@ -218,7 +218,7 @@ void ListClass::shift(ContextType ctx, ObjectType this_object, Arguments args } template -void ListClass::splice(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::splice(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); size_t size = list->size(); long index = std::min(Value::to_number(ctx, args[0]), size); @@ -251,36 +251,36 @@ void ListClass::splice(ContextType ctx, ObjectType this_object, Arguments arg } template -void ListClass::snapshot(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::snapshot(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto list = get_internal>(this_object); return_value.set(ResultsClass::create_instance(ctx, list->snapshot())); } template -void ListClass::filtered(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::filtered(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); return_value.set(ResultsClass::create_filtered(ctx, *list, args)); } template -void ListClass::sorted(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::sorted(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); return_value.set(ResultsClass::create_instance(ctx, list->sort(ResultsClass::get_keypaths(ctx, args)))); } template -void ListClass::is_valid(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::is_valid(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { return_value.set(get_internal>(this_object)->is_valid()); } template -void ListClass::is_empty(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::is_empty(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { return_value.set(get_internal>(this_object)->size() == 0); } template -void ListClass::index_of(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::index_of(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto fn = [&](auto&& row) { auto list = get_internal>(this_object); NativeAccessor accessor(ctx, *list); @@ -290,19 +290,19 @@ void ListClass::index_of(ContextType ctx, ObjectType this_object, Arguments a } template -void ListClass::add_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::add_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); ResultsClass::add_listener(ctx, *list, this_object, args); } template -void ListClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto list = get_internal>(this_object); ResultsClass::remove_listener(ctx, *list, this_object, args); } template -void ListClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ListClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto list = get_internal>(this_object); list->m_notification_tokens.clear(); diff --git a/src/js_realm.hpp b/src/js_realm.hpp index f5696553c9..4f31f51cef 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -218,26 +218,29 @@ class RealmClass : public ClassDefinition> { static FunctionType create_constructor(ContextType); // methods - static void objects(ContextType, ObjectType, Arguments, ReturnValue &); - static void object_for_primary_key(ContextType, ObjectType, Arguments, ReturnValue &); - static void create(ContextType, ObjectType, Arguments, ReturnValue &); - static void delete_one(ContextType, ObjectType, Arguments, ReturnValue &); - static void delete_all(ContextType, ObjectType, Arguments, ReturnValue &); - static void write(ContextType, ObjectType, Arguments, ReturnValue &); - static void begin_transaction(ContextType, ObjectType, Arguments, ReturnValue&); - static void commit_transaction(ContextType, ObjectType, Arguments, ReturnValue&); - static void cancel_transaction(ContextType, ObjectType, Arguments, ReturnValue&); - static void add_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void async_open_realm(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_all_listeners(ContextType, ObjectType, Arguments, ReturnValue &); - static void close(ContextType, ObjectType, Arguments, ReturnValue &); - static void compact(ContextType, ObjectType, Arguments, ReturnValue &); - static void writeCopyTo(ContextType, ObjectType, Arguments, ReturnValue &); - static void delete_model(ContextType, ObjectType, Arguments, ReturnValue &); - static void object_for_object_id(ContextType, ObjectType, Arguments, ReturnValue&); - static void privileges(ContextType, ObjectType, Arguments, ReturnValue&); - static void get_schema_name_from_object(ContextType, ObjectType, Arguments, ReturnValue&); + static void objects(ContextType, ObjectType, Arguments &, ReturnValue &); + static void object_for_primary_key(ContextType, ObjectType, Arguments &, ReturnValue &); + static void create(ContextType, ObjectType, Arguments &, ReturnValue &); + static void delete_one(ContextType, ObjectType, Arguments &, ReturnValue &); + static void delete_all(ContextType, ObjectType, Arguments &, ReturnValue &); + static void write(ContextType, ObjectType, Arguments &, ReturnValue &); + static void begin_transaction(ContextType, ObjectType, Arguments &, ReturnValue&); + static void commit_transaction(ContextType, ObjectType, Arguments &, ReturnValue&); + static void cancel_transaction(ContextType, ObjectType, Arguments &, ReturnValue&); + static void add_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void wait_for_download_completion(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_all_listeners(ContextType, ObjectType, Arguments &, ReturnValue &); + static void close(ContextType, ObjectType, Arguments &, ReturnValue &); + static void compact(ContextType, ObjectType, Arguments &, ReturnValue &); + static void writeCopyTo(ContextType, ObjectType, Arguments &, ReturnValue &); + static void delete_model(ContextType, ObjectType, Arguments &, ReturnValue &); + static void object_for_object_id(ContextType, ObjectType, Arguments &, ReturnValue&); + static void privileges(ContextType, ObjectType, Arguments &, ReturnValue&); + static void get_schema_name_from_object(ContextType, ObjectType, Arguments &, ReturnValue&); +#if REALM_ENABLE_SYNC + static void async_open_realm(ContextType, ObjectType, Arguments &, ReturnValue&); +#endif // properties static void get_empty(ContextType, ObjectType, ReturnValue &); @@ -253,15 +256,14 @@ class RealmClass : public ClassDefinition> { #endif // static methods - static void constructor(ContextType, ObjectType, size_t, const ValueType[]); + static void constructor(ContextType, ObjectType, Arguments &); static SharedRealm create_shared_realm(ContextType, realm::Realm::Config, bool, ObjectDefaultsMap &&, ConstructorMap &&); - static bool get_realm_config(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[], - Realm::Config& config, ObjectDefaultsMap& defaults, ConstructorMap& constructors); + static bool get_realm_config(ContextType ctx, ObjectType this_object, Arguments &, realm::Realm::Config &, ObjectDefaultsMap &, ConstructorMap &); - static void schema_version(ContextType, ObjectType, Arguments, ReturnValue &); - static void clear_test_state(ContextType, ObjectType, Arguments, ReturnValue &); - static void copy_bundled_realm_files(ContextType, ObjectType, Arguments, ReturnValue &); - static void delete_file(ContextType, ObjectType, Arguments, ReturnValue &); + static void schema_version(ContextType, ObjectType, Arguments &, ReturnValue &); + static void clear_test_state(ContextType, ObjectType, Arguments &, ReturnValue &); + static void copy_bundled_realm_files(ContextType, ObjectType, Arguments &, ReturnValue &); + static void delete_file(ContextType, ObjectType, Arguments &, ReturnValue &); // static properties static void get_default_path(ContextType, ObjectType, ReturnValue &); @@ -447,18 +449,16 @@ static inline void convert_outdated_datetime_columns(const SharedRealm &realm) { } template -bool RealmClass::get_realm_config(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[], - Realm::Config& config, ObjectDefaultsMap& defaults, ConstructorMap& constructors) { - if (argc > 1) { - throw std::runtime_error("Invalid arguments when constructing 'Realm'"); - } - +bool RealmClass::get_realm_config(ContextType ctx, ObjectType this_object, Arguments &args, realm::Realm::Config& config, ObjectDefaultsMap& defaults, ConstructorMap& constructors) { bool schema_updated = false; - if (argc == 0) { + + args.validate_maximum(1); + + if (args.count == 0) { config.path = default_path(); } - else if (argc == 1) { - ValueType value = arguments[0]; + else if (args.count == 1) { + ValueType value = args[0]; if (Value::is_string(ctx, value)) { config.path = Value::validated_to_string(ctx, value, "path"); } @@ -610,11 +610,11 @@ bool RealmClass::get_realm_config(ContextType ctx, ObjectType this_object, si } template -void RealmClass::constructor(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[]) { +void RealmClass::constructor(ContextType ctx, ObjectType this_object, Arguments& args) { realm::Realm::Config config; ObjectDefaultsMap defaults; ConstructorMap constructors; - bool schema_updated = get_realm_config(ctx, this_object, argc, arguments, config, defaults, constructors); + bool schema_updated = get_realm_config(ctx, this_object, args, config, defaults, constructors); auto realm = create_shared_realm(ctx, config, schema_updated, std::move(defaults), std::move(constructors)); // Fix for datetime -> timestamp conversion @@ -667,7 +667,7 @@ SharedRealm RealmClass::create_shared_realm(ContextType ctx, realm::Realm::Co } template -void RealmClass::schema_version(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::schema_version(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); realm::Realm::Config config; @@ -688,19 +688,19 @@ void RealmClass::schema_version(ContextType ctx, ObjectType this_object, Argu template -void RealmClass::clear_test_state(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::clear_test_state(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); js::clear_test_state(); } template -void RealmClass::copy_bundled_realm_files(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::copy_bundled_realm_files(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); realm::copy_bundled_realm_files(); } template -void RealmClass::delete_file(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::delete_file(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); ValueType value = args[0]; @@ -740,7 +740,7 @@ void RealmClass::delete_file(ContextType ctx, ObjectType this_object, Argumen } template -void RealmClass::delete_model(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::delete_model(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); ValueType value = args[0]; @@ -820,7 +820,7 @@ void RealmClass::get_sync_session(ContextType ctx, ObjectType object, ReturnV #if REALM_ENABLE_SYNC template -void RealmClass::async_open_realm(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::wait_for_download_completion(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); auto callback_function = Value::validated_to_function(ctx, args[0 + (args.count == 2)]); Realm::Config config; @@ -907,7 +907,7 @@ void RealmClass::async_open_realm(ContextType ctx, ObjectType this_object, Ar #endif template -void RealmClass::objects(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::objects(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); SharedRealm realm = *get_internal>(this_object); @@ -916,7 +916,7 @@ void RealmClass::objects(ContextType ctx, ObjectType this_object, Arguments a } template -void RealmClass::object_for_primary_key(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::object_for_primary_key(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); SharedRealm realm = *get_internal>(this_object); @@ -934,7 +934,7 @@ void RealmClass::object_for_primary_key(ContextType ctx, ObjectType this_obje } template -void RealmClass::create(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::create(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(3); SharedRealm realm = *get_internal>(this_object); @@ -957,7 +957,7 @@ void RealmClass::create(ContextType ctx, ObjectType this_object, Arguments ar } template -void RealmClass::delete_one(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::delete_one(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); SharedRealm realm = *get_internal>(this_object); @@ -1005,7 +1005,7 @@ void RealmClass::delete_one(ContextType ctx, ObjectType this_object, Argument } template -void RealmClass::delete_all(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::delete_all(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); SharedRealm realm = *get_internal>(this_object); @@ -1027,7 +1027,7 @@ void RealmClass::delete_all(ContextType ctx, ObjectType this_object, Argument } template -void RealmClass::write(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::write(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); SharedRealm realm = *get_internal>(this_object); @@ -1047,7 +1047,7 @@ void RealmClass::write(ContextType ctx, ObjectType this_object, Arguments arg } template -void RealmClass::begin_transaction(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::begin_transaction(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); SharedRealm realm = *get_internal>(this_object); @@ -1055,7 +1055,7 @@ void RealmClass::begin_transaction(ContextType ctx, ObjectType this_object, A } template -void RealmClass::commit_transaction(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::commit_transaction(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); SharedRealm realm = *get_internal>(this_object); @@ -1063,7 +1063,7 @@ void RealmClass::commit_transaction(ContextType ctx, ObjectType this_object, } template -void RealmClass::cancel_transaction(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::cancel_transaction(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); SharedRealm realm = *get_internal>(this_object); @@ -1071,7 +1071,7 @@ void RealmClass::cancel_transaction(ContextType ctx, ObjectType this_object, } template -void RealmClass::add_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::add_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); auto name = validated_notification_name(ctx, args[0]); @@ -1088,7 +1088,7 @@ void RealmClass::add_listener(ContextType ctx, ObjectType this_object, Argume } template -void RealmClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); auto name = validated_notification_name(ctx, args[0]); @@ -1105,7 +1105,7 @@ void RealmClass::remove_listener(ContextType ctx, ObjectType this_object, Arg } template -void RealmClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); std::string name = "change"; if (args.count) { @@ -1123,7 +1123,7 @@ void RealmClass::remove_all_listeners(ContextType ctx, ObjectType this_object } template -void RealmClass::close(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::close(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); SharedRealm realm = *get_internal>(this_object); @@ -1131,7 +1131,7 @@ void RealmClass::close(ContextType ctx, ObjectType this_object, Arguments arg } template -void RealmClass::compact(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::compact(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); SharedRealm realm = *get_internal>(this_object); @@ -1143,7 +1143,7 @@ void RealmClass::compact(ContextType ctx, ObjectType this_object, Arguments a } template -void RealmClass::writeCopyTo(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::writeCopyTo(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); if (args.count == 0) { @@ -1179,7 +1179,7 @@ void RealmClass::writeCopyTo(ContextType ctx, ObjectType this_object, Argumen } template -void RealmClass::object_for_object_id(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue& return_value) { +void RealmClass::object_for_object_id(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue& return_value) { args.validate_count(2); #if REALM_ENABLE_SYNC @@ -1202,7 +1202,7 @@ void RealmClass::object_for_object_id(ContextType ctx, ObjectType this_object } template -void RealmClass::get_schema_name_from_object(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue& return_value) { +void RealmClass::get_schema_name_from_object(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue& return_value) { args.validate_count(1); // Try to map the input to the internal schema name for the given input. This should work for managed objects and @@ -1213,7 +1213,7 @@ void RealmClass::get_schema_name_from_object(ContextType ctx, ObjectType this } template -void RealmClass::privileges(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void RealmClass::privileges(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); using Privilege = realm::ComputedPrivileges; diff --git a/src/js_realm_object.hpp b/src/js_realm_object.hpp index 4cc117ba5d..cf27e89b7a 100644 --- a/src/js_realm_object.hpp +++ b/src/js_realm_object.hpp @@ -57,13 +57,13 @@ struct RealmObjectClass : ClassDefinition { static bool set_property(ContextType, ObjectType, const String &, ValueType); static std::vector get_property_names(ContextType, ObjectType); - static void is_valid(ContextType, FunctionType, ObjectType, size_t, const ValueType [], ReturnValue &); - static void get_object_schema(ContextType, FunctionType, ObjectType, size_t, const ValueType [], ReturnValue &); - static void linking_objects(ContextType, FunctionType, ObjectType, size_t, const ValueType [], ReturnValue &); - static void linking_objects_count(ContextType, FunctionType, ObjectType, size_t, const ValueType [], ReturnValue &); - static void get_object_id(ContextType, ObjectType, Arguments, ReturnValue &); - static void is_same_object(ContextType, ObjectType, Arguments, ReturnValue &); - static void set_link(ContextType, ObjectType, Arguments, ReturnValue &); + static void is_valid(ContextType, ObjectType, Arguments &, ReturnValue &); + static void get_object_schema(ContextType, ObjectType, Arguments &, ReturnValue &); + static void linking_objects(ContextType, ObjectType, Arguments &, ReturnValue &); + static void linking_objects_count(ContextType, ObjectType, Arguments &, ReturnValue &); + static void get_object_id(ContextType, ObjectType, Arguments &, ReturnValue &); + static void is_same_object(ContextType, ObjectType, Arguments &, ReturnValue &); + static void set_link(ContextType, ObjectType, Arguments &, ReturnValue &); static void get_realm(ContextType, ObjectType, ReturnValue &); @@ -91,12 +91,12 @@ struct RealmObjectClass : ClassDefinition { }; template -void RealmObjectClass::is_valid(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { +void RealmObjectClass::is_valid(ContextType, ObjectType this_object, Arguments &, ReturnValue &return_value) { return_value.set(get_internal>(this_object)->is_valid()); } template -void RealmObjectClass::get_object_schema(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { +void RealmObjectClass::get_object_schema(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &return_value) { auto object = get_internal>(this_object); return_value.set(Schema::object_for_object_schema(ctx, object->get_object_schema())); } @@ -156,7 +156,7 @@ bool RealmObjectClass::set_property(ContextType ctx, ObjectType object, const } template -void RealmObjectClass::set_link(ContextType ctx, ObjectType object, Arguments args, ReturnValue& return_value) { +void RealmObjectClass::set_link(ContextType ctx, ObjectType object, Arguments &args, ReturnValue& return_value) { args.validate_count(2); auto realm_object = get_internal>(object); @@ -231,7 +231,7 @@ std::vector> RealmObjectClass::get_property_names(ContextType ctx, } template -void RealmObjectClass::get_object_id(ContextType ctx, ObjectType object, Arguments args, ReturnValue& return_value) { +void RealmObjectClass::get_object_id(ContextType ctx, ObjectType object, Arguments &args, ReturnValue& return_value) { args.validate_maximum(0); #if REALM_ENABLE_SYNC @@ -249,7 +249,7 @@ void RealmObjectClass::get_object_id(ContextType ctx, ObjectType object, Argu } template -void RealmObjectClass::is_same_object(ContextType ctx, ObjectType object, Arguments args, ReturnValue& return_value) { +void RealmObjectClass::is_same_object(ContextType ctx, ObjectType object, Arguments &args, ReturnValue& return_value) { args.validate_count(1); ObjectType otherObject = Value::validated_to_object(ctx, args[0]); @@ -276,7 +276,7 @@ void RealmObjectClass::is_same_object(ContextType ctx, ObjectType object, Arg } template -void RealmObjectClass::linking_objects_count(ContextType ctx, FunctionType, ObjectType object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { +void RealmObjectClass::linking_objects_count(ContextType, ObjectType object, Arguments &, ReturnValue &return_value) { auto realm_object = get_internal>(object); const Row& row = realm_object->row(); @@ -291,11 +291,11 @@ void RealmObjectClass::linking_objects_count(ContextType ctx, FunctionType, O #include "js_results.hpp" template -void realm::js::RealmObjectClass::linking_objects(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 2); +void realm::js::RealmObjectClass::linking_objects(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_count(2); - std::string object_type = Value::validated_to_string(ctx, arguments[0], "objectType"); - std::string property_name = Value::validated_to_string(ctx, arguments[1], "property"); + std::string object_type = Value::validated_to_string(ctx, args[0], "objectType"); + std::string property_name = Value::validated_to_string(ctx, args[1], "property"); auto object = get_internal>(this_object); diff --git a/src/js_results.hpp b/src/js_results.hpp index 057293ec4d..cc15df5294 100644 --- a/src/js_results.hpp +++ b/src/js_results.hpp @@ -74,40 +74,40 @@ struct ResultsClass : ClassDefinition, CollectionClass< static ObjectType create_instance(ContextType, SharedRealm, const std::string &object_type); template - static ObjectType create_filtered(ContextType, const U &, Arguments); + static ObjectType create_filtered(ContextType, const U &, Arguments &); - static std::vector> get_keypaths(ContextType, Arguments); + static std::vector> get_keypaths(ContextType, Arguments &); static void get_length(ContextType, ObjectType, ReturnValue &); static void get_type(ContextType, ObjectType, ReturnValue &); static void get_optional(ContextType, ObjectType, ReturnValue &); static void get_index(ContextType, ObjectType, uint32_t, ReturnValue &); - static void snapshot(ContextType, ObjectType, Arguments, ReturnValue &); - static void filtered(ContextType, ObjectType, Arguments, ReturnValue &); - static void sorted(ContextType, ObjectType, Arguments, ReturnValue &); - static void is_valid(ContextType, ObjectType, Arguments, ReturnValue &); - static void is_empty(ContextType, ObjectType, Arguments, ReturnValue &); + static void snapshot(ContextType, ObjectType, Arguments &, ReturnValue &); + static void filtered(ContextType, ObjectType, Arguments &, ReturnValue &); + static void sorted(ContextType, ObjectType, Arguments &, ReturnValue &); + static void is_valid(ContextType, ObjectType, Arguments &, ReturnValue &); + static void is_empty(ContextType, ObjectType, Arguments &, ReturnValue &); #if REALM_ENABLE_SYNC - static void subscribe(ContextType, ObjectType, Arguments, ReturnValue &); + static void subscribe(ContextType, ObjectType, Arguments &, ReturnValue &); #endif - static void index_of(ContextType, ObjectType, Arguments, ReturnValue &); + static void index_of(ContextType, ObjectType, Arguments &, ReturnValue &); template - static void index_of(ContextType, Fn&, Arguments, ReturnValue &); + static void index_of(ContextType, Fn&, Arguments &, ReturnValue &); - static void update(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); + static void update(ContextType, ObjectType, Arguments &, ReturnValue &); // observable - static void add_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_all_listeners(ContextType, ObjectType, Arguments, ReturnValue &); + static void add_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_all_listeners(ContextType, ObjectType, Arguments &, ReturnValue &); template - static void add_listener(ContextType, U&, ObjectType, Arguments); + static void add_listener(ContextType, U&, ObjectType, Arguments &); template - static void remove_listener(ContextType, U&, ObjectType, Arguments); + static void remove_listener(ContextType, U&, ObjectType, Arguments &); std::string const name = "Results"; @@ -171,7 +171,7 @@ inline void alias_backlinks(parser::KeyPathMapping &mapping, const realm::Shared template template -typename T::Object ResultsClass::create_filtered(ContextType ctx, const U &collection, Arguments args) { +typename T::Object ResultsClass::create_filtered(ContextType ctx, const U &collection, Arguments &args) { if (collection.get_type() != realm::PropertyType::Object) { throw std::runtime_error("Filtering non-object Lists and Results is not yet implemented."); } @@ -196,7 +196,7 @@ typename T::Object ResultsClass::create_filtered(ContextType ctx, const U &co template std::vector> -ResultsClass::get_keypaths(ContextType ctx, Arguments args) { +ResultsClass::get_keypaths(ContextType ctx, Arguments &args) { args.validate_maximum(2); std::vector> sort_order; @@ -262,37 +262,37 @@ void ResultsClass::get_index(ContextType ctx, ObjectType object, uint32_t ind } template -void ResultsClass::snapshot(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::snapshot(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto results = get_internal>(this_object); return_value.set(ResultsClass::create_instance(ctx, results->snapshot())); } template -void ResultsClass::filtered(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::filtered(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto results = get_internal>(this_object); return_value.set(create_filtered(ctx, *results, args)); } template -void ResultsClass::sorted(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::sorted(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto results = get_internal>(this_object); return_value.set(ResultsClass::create_instance(ctx, results->sort(ResultsClass::get_keypaths(ctx, args)))); } template -void ResultsClass::is_valid(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::is_valid(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { return_value.set(get_internal>(this_object)->is_valid()); } template -void ResultsClass::is_empty(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::is_empty(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { return_value.set(get_internal>(this_object)->size() == 0); } #if REALM_ENABLE_SYNC template -void ResultsClass::subscribe(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::subscribe(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); auto results = get_internal>(this_object); @@ -314,7 +314,7 @@ void ResultsClass::subscribe(ContextType ctx, ObjectType this_object, Argumen template template -void ResultsClass::index_of(ContextType ctx, Fn& fn, Arguments args, ReturnValue &return_value) { +void ResultsClass::index_of(ContextType ctx, Fn& fn, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); size_t ndx; @@ -337,10 +337,10 @@ void ResultsClass::index_of(ContextType ctx, Fn& fn, Arguments args, ReturnVa } template -void ResultsClass::update(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 2); +void ResultsClass::update(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_maximum(2); - std::string property = Value::validated_to_string(ctx, arguments[0], "property"); + std::string property = Value::validated_to_string(ctx, args[0], "property"); auto results = get_internal>(this_object); auto schema = results->get_object_schema(); @@ -358,13 +358,13 @@ void ResultsClass::update(ContextType ctx, FunctionType, ObjectType this_obje for (auto i = results->size(); i > 0; i--) { auto realm_object = realm::Object(realm, schema, results->get(i - 1)); auto obj = RealmObjectClass::create_instance(ctx, realm_object); - RealmObjectClass::set_property(ctx, obj, property, arguments[1]); + RealmObjectClass::set_property(ctx, obj, property, args[1]); } } template void ResultsClass::index_of(ContextType ctx, ObjectType this_object, - Arguments args, ReturnValue &return_value) { + Arguments &args, ReturnValue &return_value) { auto fn = [&](auto&& row) { auto results = get_internal>(this_object); NativeAccessor accessor(ctx, *results); @@ -375,7 +375,7 @@ void ResultsClass::index_of(ContextType ctx, ObjectType this_object, template template -void ResultsClass::add_listener(ContextType ctx, U& collection, ObjectType this_object, Arguments args) { +void ResultsClass::add_listener(ContextType ctx, U& collection, ObjectType this_object, Arguments &args) { args.validate_maximum(1); auto callback = Value::validated_to_function(ctx, args[0]); @@ -395,14 +395,14 @@ void ResultsClass::add_listener(ContextType ctx, U& collection, ObjectType th } template -void ResultsClass::add_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::add_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto results = get_internal>(this_object); add_listener(ctx, *results, this_object, args); } template template -void ResultsClass::remove_listener(ContextType ctx, U& collection, ObjectType this_object, Arguments args) { +void ResultsClass::remove_listener(ContextType ctx, U& collection, ObjectType this_object, Arguments &args) { args.validate_maximum(1); auto callback = Value::validated_to_function(ctx, args[0]); @@ -416,13 +416,13 @@ void ResultsClass::remove_listener(ContextType ctx, U& collection, ObjectType } template -void ResultsClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { auto results = get_internal>(this_object); remove_listener(ctx, *results, this_object, args); } template -void ResultsClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void ResultsClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto results = get_internal>(this_object); diff --git a/src/js_sync.hpp b/src/js_sync.hpp index bdef3467d3..569ad312fe 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -89,9 +89,9 @@ class UserClass : public ClassDefinition { {"isAdminToken", {wrap, nullptr}}, }; - static void create_user(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); - static void admin_user(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); - static void get_existing_user(ContextType, ObjectType, Arguments, ReturnValue&); + static void create_user(ContextType, ObjectType, Arguments &, ReturnValue &); + static void admin_user(ContextType, ObjectType, Arguments &, ReturnValue &); + static void get_existing_user(ContextType, ObjectType, Arguments &, ReturnValue&); MethodMap const static_methods = { {"createUser", wrap}, @@ -100,15 +100,15 @@ class UserClass : public ClassDefinition { }; /*static void current_user(ContextType ctx, ObjectType object, ReturnValue &return_value);*/ - static void all_users(ContextType ctx, ObjectType object, ReturnValue &return_value); + static void all_users(ContextType ctx, ObjectType object, ReturnValue &); PropertyMap const static_properties = { /*{"current", {wrap, nullptr}},*/ {"all", {wrap, nullptr}}, }; - static void logout(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); - static void session_for_on_disk_path(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); + static void logout(ContextType, ObjectType, Arguments &, ReturnValue &); + static void session_for_on_disk_path(ContextType, ObjectType, Arguments &, ReturnValue &); MethodMap const methods = { {"_logout", wrap}, @@ -145,39 +145,39 @@ void UserClass::is_admin_token(ContextType ctx, ObjectType object, ReturnValu } template -void UserClass::create_user(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 3, 5); +void UserClass::create_user(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_between(3, 5); SyncUserIdentifier userIdentifier { - Value::validated_to_string(ctx, arguments[1], "identity"), - Value::validated_to_string(ctx, arguments[0], "authServerUrl") + Value::validated_to_string(ctx, args[1], "identity"), + Value::validated_to_string(ctx, args[0], "authServerUrl") }; SharedUser *user = new SharedUser(syncManagerShared().get_user( userIdentifier, - Value::validated_to_string(ctx, arguments[2], "refreshToken") + Value::validated_to_string(ctx, args[2], "refreshToken") )); - if (argc == 5) { - (*user)->set_is_admin(Value::validated_to_boolean(ctx, arguments[4], "isAdmin")); + if (args.count == 5) { + (*user)->set_is_admin(Value::validated_to_boolean(ctx, args[4], "isAdmin")); } return_value.set(create_object>(ctx, user)); } template -void UserClass::admin_user(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 2, 2); +void UserClass::admin_user(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_count(2); SharedUser *user = new SharedUser(syncManagerShared().get_admin_token_user( - Value::validated_to_string(ctx, arguments[0], "authServerUrl"), - Value::validated_to_string(ctx, arguments[1], "refreshToken") + Value::validated_to_string(ctx, args[0], "authServerUrl"), + Value::validated_to_string(ctx, args[1], "refreshToken") )); return_value.set(create_object>(ctx, user)); } template -void UserClass::get_existing_user(ContextType ctx, ObjectType, Arguments arguments, ReturnValue& return_value) { - arguments.validate_count(2); +void UserClass::get_existing_user(ContextType ctx, ObjectType, Arguments &args, ReturnValue &return_value) { + args.validate_count(2); if (auto user = syncManagerShared().get_existing_logged_in_user(SyncUserIdentifier{ - Value::validated_to_string(ctx, arguments[1], "identity"), - Value::validated_to_string(ctx, arguments[0], "authServerUrl")})) { + Value::validated_to_string(ctx, args[1], "identity"), + Value::validated_to_string(ctx, args[0], "authServerUrl")})) { return_value.set(create_object>(ctx, new SharedUser(std::move(user)))); } } @@ -194,7 +194,7 @@ void UserClass::all_users(ContextType ctx, ObjectType object, ReturnValue &re } template -void UserClass::logout(ContextType ctx, FunctionType, ObjectType this_object, size_t, const ValueType[], ReturnValue &) { +void UserClass::logout(ContextType, ObjectType this_object, Arguments &, ReturnValue &) { get_internal>(this_object)->get()->log_out(); } @@ -224,20 +224,18 @@ class SessionClass : public ClassDefinition { static void get_state(ContextType, ObjectType, ReturnValue &); static void get_connection_state(ContextType, ObjectType, ReturnValue &); - static void simulate_error(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); - static void refresh_access_token(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); - static void add_progress_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void remove_progress_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void add_state_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void remove_state_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void add_connection_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void remove_connection_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void is_connected(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void resume(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - static void pause(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &); - - - static void override_server(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue&); + static void simulate_error(ContextType, ObjectType, Arguments &, ReturnValue &); + static void refresh_access_token(ContextType, ObjectType, Arguments &, ReturnValue &); + static void add_progress_notification(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void remove_progress_notification(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void add_state_notification(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void remove_state_notification(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void add_connection_notification(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void remove_connection_notification(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void is_connected(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void resume(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void pause(ContextType ctx, ObjectType this_object, Arguments &, ReturnValue &); + static void override_server(ContextType, ObjectType, Arguments &, ReturnValue &); PropertyMap const properties = { {"config", {wrap, nullptr}}, @@ -403,9 +401,10 @@ class SSLVerifyCallbackSyncThreadFunctor { }; template -void UserClass::session_for_on_disk_path(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { +void UserClass::session_for_on_disk_path(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_count(1); auto user = *get_internal>(this_object); - if (auto session = user->session_for_on_disk_path(Value::validated_to_string(ctx, arguments[0]))) { + if (auto session = user->session_for_on_disk_path(Value::validated_to_string(ctx, args[0]))) { return_value.set(create_object>(ctx, new WeakSession(session))); } else { return_value.set_undefined(); @@ -492,38 +491,38 @@ void SessionClass::get_connection_state(ContextType ctx, ObjectType object, R } template -void SessionClass::simulate_error(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &) { - validate_argument_count(argc, 2); +void SessionClass::simulate_error(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &) { + args.validate_count(2); if (auto session = get_internal>(this_object)->lock()) { - std::error_code error_code(Value::validated_to_number(ctx, arguments[0]), realm::sync::protocol_error_category()); - std::string message = Value::validated_to_string(ctx, arguments[1]); + std::error_code error_code(Value::validated_to_number(ctx, args[0]), realm::sync::protocol_error_category()); + std::string message = Value::validated_to_string(ctx, args[1]); SyncSession::OnlyForTesting::handle_error(*session, SyncError(error_code, message, false)); } } template -void SessionClass::refresh_access_token(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &) { - validate_argument_count(argc, 3); +void SessionClass::refresh_access_token(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &) { + args.validate_count(3); if (auto session = get_internal>(this_object)->lock()) { - std::string sync_label = Value::validated_to_string(ctx, arguments[2], "syncLabel"); + std::string sync_label = Value::validated_to_string(ctx, args[2], "syncLabel"); session->set_multiplex_identifier(std::move(sync_label)); - std::string access_token = Value::validated_to_string(ctx, arguments[0], "accessToken"); - std::string realm_url = Value::validated_to_string(ctx, arguments[1], "realmUrl"); + std::string access_token = Value::validated_to_string(ctx, args[0], "accessToken"); + std::string realm_url = Value::validated_to_string(ctx, args[1], "realmUrl"); session->refresh_access_token(std::move(access_token), std::move(realm_url)); } } template -void SessionClass::add_progress_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 3); +void SessionClass::add_progress_notification(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_count(3); if (auto session = get_internal>(this_object)->lock()) { - std::string direction = Value::validated_to_string(ctx, arguments[0], "direction"); - std::string mode = Value::validated_to_string(ctx, arguments[1], "mode"); + std::string direction = Value::validated_to_string(ctx, args[0], "direction"); + std::string mode = Value::validated_to_string(ctx, args[1], "mode"); SyncSession::NotifierType notifierType; if (direction == "download") { notifierType = SyncSession::NotifierType::download; @@ -546,7 +545,7 @@ void SessionClass::add_progress_notification(ContextType ctx, FunctionType, O throw std::invalid_argument("Invalid argument 'mode'. Only 'reportIndefinitely' and 'forCurrentlyOutstandingWork' progress notification modes are supported"); } - auto callback_function = Value::validated_to_function(ctx, arguments[2], "callback"); + auto callback_function = Value::validated_to_function(ctx, args[2], "callback"); Protected protected_callback(ctx, callback_function); Protected protected_this(ctx, this_object); @@ -573,9 +572,9 @@ void SessionClass::add_progress_notification(ContextType ctx, FunctionType, O } template -void SessionClass::remove_progress_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 1); - auto callback_function = Value::validated_to_function(ctx, arguments[0], "callback"); +void SessionClass::remove_progress_notification(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_count(1); + auto callback_function = Value::validated_to_function(ctx, args[0], "callback"); auto syncSessionProp = Object::get_property(ctx, callback_function, "_syncSession"); if (Value::is_undefined(ctx, syncSessionProp) || Value::is_null(ctx, syncSessionProp)) { return; @@ -591,10 +590,10 @@ void SessionClass::remove_progress_notification(ContextType ctx, FunctionType } template -void SessionClass::add_connection_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 1); +void SessionClass::add_connection_notification(ContextType ctx, ObjectType this_object, Arguments& args, ReturnValue &return_value) { + args.validate_count(1); if (auto session = get_internal>(this_object)->lock()) { - auto callback_function = Value::validated_to_function(ctx, arguments[0], "callback"); + auto callback_function = Value::validated_to_function(ctx, args[0], "callback"); Protected protected_callback(ctx, callback_function); Protected protected_this(ctx, this_object); Protected protected_ctx(Context::get_global_context(ctx)); @@ -620,9 +619,9 @@ void SessionClass::add_connection_notification(ContextType ctx, FunctionType, } template -void SessionClass::remove_connection_notification(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 1); - auto callback_function = Value::validated_to_function(ctx, arguments[0], "callback"); +void SessionClass::remove_connection_notification(ContextType ctx, ObjectType this_object, Arguments& args, ReturnValue &return_value) { + args.validate_count(1); + auto callback_function = Value::validated_to_function(ctx, args[0], "callback"); auto syncSessionProp = Object::get_property(ctx, callback_function, "_syncSession"); if (Value::is_undefined(ctx, syncSessionProp) || Value::is_null(ctx, syncSessionProp)) { return; @@ -637,8 +636,8 @@ void SessionClass::remove_connection_notification(ContextType ctx, FunctionTy } template -void SessionClass::is_connected(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 0); +void SessionClass::is_connected(ContextType ctx, ObjectType this_object, Arguments& args, ReturnValue &return_value) { + args.validate_count(0); return_value.set(false); if (auto session = get_internal>(this_object)->lock()) { auto state = session->state(); @@ -651,8 +650,8 @@ void SessionClass::is_connected(ContextType ctx, FunctionType, ObjectType thi } template -void SessionClass::resume(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 0); +void SessionClass::resume(ContextType ctx, ObjectType this_object, Arguments& args, ReturnValue &return_value) { + args.validate_count(0); return_value.set(false); if (auto session = get_internal>(this_object)->lock()) { session->revive_if_needed(); @@ -660,8 +659,8 @@ void SessionClass::resume(ContextType ctx, FunctionType, ObjectType this_obje } template -void SessionClass::pause(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 0); +void SessionClass::pause(ContextType ctx, ObjectType this_object, Arguments& args, ReturnValue &return_value) { + args.validate_count(0); return_value.set(false); if (auto session = get_internal>(this_object)->lock()) { session->log_out(); @@ -669,7 +668,7 @@ void SessionClass::pause(ContextType ctx, FunctionType, ObjectType this_objec } template -void SessionClass::override_server(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue&) { +void SessionClass::override_server(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue&) { args.validate_count(2); std::string address = Value::validated_to_string(ctx, args[0], "address"); @@ -719,10 +718,10 @@ class SubscriptionClass : public ClassDefinition> { static void get_error(ContextType, ObjectType, ReturnValue &); static void get_name(ContextType, ObjectType, ReturnValue &); - static void unsubscribe(ContextType, ObjectType, Arguments, ReturnValue &); - static void add_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_listener(ContextType, ObjectType, Arguments, ReturnValue &); - static void remove_all_listeners(ContextType, ObjectType, Arguments, ReturnValue &); + static void unsubscribe(ContextType, ObjectType, Arguments &, ReturnValue &); + static void add_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_listener(ContextType, ObjectType, Arguments &, ReturnValue &); + static void remove_all_listeners(ContextType, ObjectType, Arguments &, ReturnValue &); PropertyMap const properties = { {"state", {wrap, nullptr}}, @@ -778,7 +777,7 @@ void SubscriptionClass::get_name(ContextType ctx, ObjectType object, ReturnVa } template -void SubscriptionClass::unsubscribe(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void SubscriptionClass::unsubscribe(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto subscription = get_internal>(this_object); partial_sync::unsubscribe(*subscription); @@ -786,7 +785,7 @@ void SubscriptionClass::unsubscribe(ContextType ctx, ObjectType this_object, } template -void SubscriptionClass::add_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void SubscriptionClass::add_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); auto subscription = get_internal>(this_object); @@ -808,7 +807,7 @@ void SubscriptionClass::add_listener(ContextType ctx, ObjectType this_object, } template -void SubscriptionClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void SubscriptionClass::remove_listener(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(1); auto subscription = get_internal>(this_object); @@ -823,7 +822,7 @@ void SubscriptionClass::remove_listener(ContextType ctx, ObjectType this_obje } template -void SubscriptionClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments args, ReturnValue &return_value) { +void SubscriptionClass::remove_all_listeners(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(0); auto subscription = get_internal>(this_object); subscription->m_notification_tokens.clear(); @@ -841,14 +840,15 @@ class SyncClass : public ClassDefinition { using Value = js::Value; using Function = js::Function; using ReturnValue = js::ReturnValue; + using Arguments = js::Arguments; public: std::string const name = "Sync"; static FunctionType create_constructor(ContextType); - static void set_sync_log_level(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); - static void initiate_client_reset(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &); + static void set_sync_log_level(ContextType, ObjectType, Arguments &, ReturnValue &); + static void initiate_client_reset(ContextType, ObjectType, Arguments &, ReturnValue &); // private static std::function session_bind_callback(ContextType ctx, ObjectType sync_constructor); @@ -876,18 +876,18 @@ inline typename T::Function SyncClass::create_constructor(ContextType ctx) { } template -void SyncClass::initiate_client_reset(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue & return_value) { - validate_argument_count(argc, 1); - std::string path = Value::validated_to_string(ctx, arguments[0]); +void SyncClass::initiate_client_reset(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue & return_value) { + args.validate_count(1); + std::string path = Value::validated_to_string(ctx, args[0]); if (!SyncManager::shared().immediately_run_file_actions(std::string(path))) { throw std::runtime_error(util::format("Realm was not configured correctly. Client Reset could not be run for Realm at: %1", path)); } } template -void SyncClass::set_sync_log_level(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { - validate_argument_count(argc, 1); - std::string log_level = Value::validated_to_string(ctx, arguments[0]); +void SyncClass::set_sync_log_level(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { + args.validate_count(1); + std::string log_level = Value::validated_to_string(ctx, args[0]); std::istringstream in(log_level); // Throws in.imbue(std::locale::classic()); // Throws in.unsetf(std::ios_base::skipws); diff --git a/src/js_util.hpp b/src/js_util.hpp index 59faf4aad2..b41cecb6c5 100644 --- a/src/js_util.hpp +++ b/src/js_util.hpp @@ -85,7 +85,7 @@ static inline void validate_argument_count_at_least(size_t count, size_t expecte template void compute_aggregate_on_collection(typename T::ContextType ctx, typename T::ObjectType this_object, - typename T::Arguments args, typename T::ReturnValue &return_value) { + typename T::Arguments &args, typename T::ReturnValue &return_value) { auto list = get_internal(this_object); diff --git a/src/jsc/jsc_class.hpp b/src/jsc/jsc_class.hpp index 031e26dde8..738f55ebd1 100644 --- a/src/jsc/jsc_class.hpp +++ b/src/jsc/jsc_class.hpp @@ -31,7 +31,6 @@ using ClassDefinition = js::ClassDefinition; using ConstructorType = js::ConstructorType; using ArgumentsMethodType = js::ArgumentsMethodType; -using MethodType = js::MethodType; using Arguments = js::Arguments; using PropertyType = js::PropertyType; using IndexPropertyType = js::IndexPropertyType; @@ -229,8 +228,9 @@ inline JSValueRef ObjectWrap::call(JSContextRef ctx, JSObjectRef func // Classes without a constructor should still be subclassable. if (reinterpret_cast(s_class.constructor)) { + jsc::Arguments args{ctx, argc, arguments}; try { - s_class.constructor(ctx, this_object, argc, arguments); + s_class.constructor(ctx, this_object, args); } catch (std::exception &e) { *exception = jsc::Exception::value(ctx, e); @@ -249,8 +249,9 @@ inline JSObjectRef ObjectWrap::construct(JSContextRef ctx, JSObjectRe } JSObjectRef this_object = create_instance(ctx); + jsc::Arguments args{ctx, argc, arguments}; try { - s_class.constructor(ctx, this_object, argc, arguments); + s_class.constructor(ctx, this_object, args); } catch (std::exception &e) { *exception = jsc::Exception::value(ctx, e); @@ -381,24 +382,12 @@ namespace js { template class ObjectWrap : public jsc::ObjectWrap {}; -template -JSValueRef wrap(JSContextRef ctx, JSObjectRef function, JSObjectRef this_object, size_t argc, const JSValueRef arguments[], JSValueRef* exception) { - jsc::ReturnValue return_value(ctx); - try { - F(ctx, function, this_object, argc, arguments, return_value); - return return_value; - } - catch (std::exception &e) { - *exception = jsc::Exception::value(ctx, e); - return nullptr; - } -} - template JSValueRef wrap(JSContextRef ctx, JSObjectRef, JSObjectRef this_object, size_t argc, const JSValueRef arguments[], JSValueRef* exception) { + jsc::Arguments args{ctx, argc, arguments}; jsc::ReturnValue return_value(ctx); try { - F(ctx, this_object, jsc::Arguments{ctx, argc, arguments}, return_value); + F(ctx, this_object, args, return_value); return return_value; } catch (std::exception &e) { diff --git a/src/node/node_class.hpp b/src/node/node_class.hpp index e4693b1909..88ff595fc2 100644 --- a/src/node/node_class.hpp +++ b/src/node/node_class.hpp @@ -30,7 +30,6 @@ template using ClassDefinition = js::ClassDefinition; using ConstructorType = js::ConstructorType; -using MethodType = js::MethodType; using ArgumentsMethodType = js::ArgumentsMethodType; using Arguments = js::Arguments; using PropertyType = js::PropertyType; @@ -51,7 +50,7 @@ class ObjectWrap : public Nan::ObjectWrap { return Nan::New(js_template); } - static void construct(const v8::FunctionCallbackInfo&); + static void construct(const Nan::FunctionCallbackInfo&); static bool has_instance(v8::Isolate* isolate, const v8::Local &value) { return get_template()->HasInstance(value); @@ -77,26 +76,26 @@ class ObjectWrap : public Nan::ObjectWrap { static v8::Local create_template(); - static void setup_method(v8::Local, const std::string &, v8::FunctionCallback); - static void setup_static_method(v8::Local, const std::string &, v8::FunctionCallback); + static void setup_method(v8::Local, const std::string &, Nan::FunctionCallback); + static void setup_static_method(v8::Local, const std::string &, Nan::FunctionCallback); template static void setup_property(v8::Local, const std::string &, const PropertyType &); - static void get_indexes(const v8::PropertyCallbackInfo&); - static void set_property(v8::Local, v8::Local, const v8::PropertyCallbackInfo&); + static void get_indexes(const Nan::PropertyCallbackInfo&); + static void set_property(v8::Local, v8::Local, const Nan::PropertyCallbackInfo&); - static void set_readonly_property(v8::Local property, v8::Local value, const v8::PropertyCallbackInfo& info) { + static void set_readonly_property(v8::Local property, v8::Local value, const Nan::PropertyCallbackInfo& info) { std::string message = std::string("Cannot assign to read only property '") + std::string(String(property)) + "'"; Nan::ThrowError(message.c_str()); } - static void set_readonly_index(uint32_t index, v8::Local value, const v8::PropertyCallbackInfo& info) { + static void set_readonly_index(uint32_t index, v8::Local value, const Nan::PropertyCallbackInfo& info) { std::string message = std::string("Cannot assign to read only index ") + util::to_string(index); Nan::ThrowError(message.c_str()); } - static void get_nonexistent_property(v8::Local, const v8::PropertyCallbackInfo&) { + static void get_nonexistent_property(v8::Local, const Nan::PropertyCallbackInfo&) { // Do nothing. This function exists only to prevent a crash where it is used. } }; @@ -112,7 +111,7 @@ class ObjectWrap { }; // This helper function is needed outside the scope of the ObjectWrap class as well. -static inline std::vector> get_arguments(const v8::FunctionCallbackInfo &info) { +static inline std::vector> get_arguments(const Nan::FunctionCallbackInfo &info) { int count = info.Length(); std::vector> arguments; arguments.reserve(count); @@ -159,7 +158,7 @@ template inline v8::Local ObjectWrap::create_template() { Nan::EscapableHandleScope scope; - v8::Local tpl = v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), construct); + v8::Local tpl = Nan::New(construct); v8::Local instance_tpl = tpl->InstanceTemplate(); v8::Local name = Nan::New(s_class.name).ToLocalChecked(); @@ -184,21 +183,21 @@ inline v8::Local ObjectWrap::create_template() if (s_class.index_accessor.getter) { auto &index_accessor = s_class.index_accessor; - instance_tpl->SetIndexedPropertyHandler(index_accessor.getter, index_accessor.setter ? index_accessor.setter : set_readonly_index, 0, 0, get_indexes); + Nan::SetIndexedPropertyHandler(instance_tpl, index_accessor.getter, index_accessor.setter ? index_accessor.setter : set_readonly_index, 0, 0, get_indexes); } if (s_class.string_accessor.getter || s_class.index_accessor.getter || s_class.index_accessor.setter) { // Use our own wrapper for the setter since we want to throw for negative indices. auto &string_accessor = s_class.string_accessor; - instance_tpl->SetNamedPropertyHandler(string_accessor.getter ? string_accessor.getter : get_nonexistent_property, set_property, 0, 0, string_accessor.enumerator); + Nan::SetNamedPropertyHandler(instance_tpl, string_accessor.getter ? string_accessor.getter : get_nonexistent_property, set_property, 0, 0, string_accessor.enumerator); } return scope.Escape(tpl); } template -inline void ObjectWrap::setup_method(v8::Local tpl, const std::string &name, v8::FunctionCallback callback) { +inline void ObjectWrap::setup_method(v8::Local tpl, const std::string &name, Nan::FunctionCallback callback) { v8::Local signature = Nan::New(tpl); - v8::Local fn_tpl = v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), callback, v8::Local(), signature); + v8::Local fn_tpl = Nan::New(callback, v8::Local(), signature); v8::Local fn_name = Nan::New(name).ToLocalChecked(); // The reason we use this rather than Nan::SetPrototypeMethod is DontEnum. @@ -207,8 +206,8 @@ inline void ObjectWrap::setup_method(v8::Local } template -inline void ObjectWrap::setup_static_method(v8::Local tpl, const std::string &name, v8::FunctionCallback callback) { - v8::Local fn_tpl = v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), callback); +inline void ObjectWrap::setup_static_method(v8::Local tpl, const std::string &name, Nan::FunctionCallback callback) { + v8::Local fn_tpl = Nan::New(callback); v8::Local fn_name = Nan::New(name).ToLocalChecked(); tpl->Set(fn_name, fn_tpl, v8::PropertyAttribute::DontEnum); @@ -221,17 +220,18 @@ inline void ObjectWrap::setup_property(v8::Local target, v8::Local prop_name = Nan::New(name).ToLocalChecked(); v8::PropertyAttribute attributes = v8::PropertyAttribute(v8::DontEnum | v8::DontDelete); - target->SetAccessor(prop_name, property.getter, property.setter ? property.setter : set_readonly_property, v8::Local(), v8::DEFAULT, attributes); + Nan::SetAccessor(target, prop_name, property.getter, property.setter ? property.setter : set_readonly_property, v8::Local(), v8::DEFAULT, attributes); } template -inline void ObjectWrap::construct(const v8::FunctionCallbackInfo& info) { +inline void ObjectWrap::construct(const Nan::FunctionCallbackInfo& info) { if (!info.IsConstructCall()) { Nan::ThrowError("Constructor must be called with new"); } if (reinterpret_cast(s_class.constructor)) { auto isolate = info.GetIsolate(); auto arguments = get_arguments(info); + node::Arguments args{isolate, arguments.size(), arguments.data()}; v8::Local this_object = info.This(); info.GetReturnValue().Set(this_object); @@ -239,7 +239,7 @@ inline void ObjectWrap::construct(const v8::FunctionCallbackInfoWrap(this_object); try { - s_class.constructor(isolate, this_object, arguments.size(), arguments.data()); + s_class.constructor(isolate, this_object, args); } catch (std::exception &e) { Nan::ThrowError(node::Exception::value(isolate, e)); @@ -251,7 +251,7 @@ inline void ObjectWrap::construct(const v8::FunctionCallbackInfo -inline void ObjectWrap::get_indexes(const v8::PropertyCallbackInfo& info) { +inline void ObjectWrap::get_indexes(const Nan::PropertyCallbackInfo& info) { uint32_t length; try { length = Object::validated_get_length(info.GetIsolate(), info.This()); @@ -270,7 +270,7 @@ inline void ObjectWrap::get_indexes(const v8::PropertyCallbackInfo -inline void ObjectWrap::set_property(v8::Local property, v8::Local value, const v8::PropertyCallbackInfo& info) { +inline void ObjectWrap::set_property(v8::Local property, v8::Local value, const Nan::PropertyCallbackInfo& info) { if (s_class.index_accessor.getter || s_class.index_accessor.setter) { try { // Negative indices are passed into this string property interceptor, so check for them here. @@ -296,28 +296,15 @@ namespace js { template class ObjectWrap : public node::ObjectWrap {}; -template -void wrap(const v8::FunctionCallbackInfo& info) { - v8::Isolate* isolate = info.GetIsolate(); - node::ReturnValue return_value(info.GetReturnValue()); - auto arguments = node::get_arguments(info); - - try { - F(isolate, info.Callee(), info.This(), arguments.size(), arguments.data(), return_value); - } - catch (std::exception &e) { - Nan::ThrowError(node::Exception::value(isolate, e)); - } -} - template -void wrap(const v8::FunctionCallbackInfo& info) { +void wrap(const Nan::FunctionCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - node::ReturnValue return_value(info.GetReturnValue()); auto arguments = node::get_arguments(info); + node::Arguments args{isolate, arguments.size(), arguments.data()}; + node::ReturnValue return_value(info.GetReturnValue()); try { - F(isolate, info.This(), node::Arguments{isolate, arguments.size(), arguments.data()}, return_value); + F(isolate, info.This(), args, return_value); } catch (std::exception &e) { Nan::ThrowError(node::Exception::value(isolate, e)); @@ -326,7 +313,7 @@ void wrap(const v8::FunctionCallbackInfo& info) { template -void wrap(v8::Local property, const v8::PropertyCallbackInfo& info) { +void wrap(v8::Local property, const Nan::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); node::ReturnValue return_value(info.GetReturnValue()); try { @@ -338,7 +325,7 @@ void wrap(v8::Local property, const v8::PropertyCallbackInfo -void wrap(v8::Local property, v8::Local value, const v8::PropertyCallbackInfo& info) { +void wrap(v8::Local property, v8::Local value, const Nan::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); try { F(isolate, info.This(), value); @@ -349,7 +336,7 @@ void wrap(v8::Local property, v8::Local value, const v8:: } template -void wrap(uint32_t index, const v8::PropertyCallbackInfo& info) { +void wrap(uint32_t index, const Nan::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); node::ReturnValue return_value(info.GetReturnValue()); try { @@ -365,7 +352,7 @@ void wrap(uint32_t index, const v8::PropertyCallbackInfo& info) { } template -void wrap(uint32_t index, v8::Local value, const v8::PropertyCallbackInfo& info) { +void wrap(uint32_t index, v8::Local value, const Nan::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); try { if (F(isolate, info.This(), index, value)) { @@ -379,7 +366,7 @@ void wrap(uint32_t index, v8::Local value, const v8::PropertyCallback } template -void wrap(v8::Local property, const v8::PropertyCallbackInfo& info) { +void wrap(v8::Local property, const Nan::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); node::ReturnValue return_value(info.GetReturnValue()); try { @@ -391,7 +378,7 @@ void wrap(v8::Local property, const v8::PropertyCallbackInfo -void wrap(v8::Local property, v8::Local value, const v8::PropertyCallbackInfo& info) { +void wrap(v8::Local property, v8::Local value, const Nan::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); try { if (F(isolate, info.This(), property, value)) { @@ -405,7 +392,7 @@ void wrap(v8::Local property, v8::Local value, const v8:: } template -void wrap(const v8::PropertyCallbackInfo& info) { +void wrap(const Nan::PropertyCallbackInfo& info) { auto names = F(info.GetIsolate(), info.This()); int count = (int)names.size(); v8::Local array = Nan::New(count); diff --git a/src/node/node_return_value.hpp b/src/node/node_return_value.hpp index dfb3a1d76f..7ee768ac5e 100644 --- a/src/node/node_return_value.hpp +++ b/src/node/node_return_value.hpp @@ -25,10 +25,10 @@ namespace js { template<> class ReturnValue { - v8::ReturnValue m_value; + Nan::ReturnValue m_value; public: - ReturnValue(v8::ReturnValue value) : m_value(value) {} + ReturnValue(Nan::ReturnValue value) : m_value(value) {} void set(const v8::Local &value) { m_value.Set(value); diff --git a/src/node/node_types.hpp b/src/node/node_types.hpp index b041e861ad..09dfea5385 100644 --- a/src/node/node_types.hpp +++ b/src/node/node_types.hpp @@ -43,15 +43,15 @@ struct Types { using String = v8::Local; using Function = v8::Local; - using ConstructorCallback = v8::FunctionCallback; - using FunctionCallback = v8::FunctionCallback; - using PropertyGetterCallback = v8::AccessorGetterCallback; - using PropertySetterCallback = v8::AccessorSetterCallback; - using IndexPropertyGetterCallback = v8::IndexedPropertyGetterCallback; - using IndexPropertySetterCallback = v8::IndexedPropertySetterCallback; - using StringPropertyGetterCallback = v8::NamedPropertyGetterCallback; - using StringPropertySetterCallback = v8::NamedPropertySetterCallback; - using StringPropertyEnumeratorCallback = v8::NamedPropertyEnumeratorCallback; + using ConstructorCallback = Nan::FunctionCallback; + using FunctionCallback = Nan::FunctionCallback; + using PropertyGetterCallback = Nan::GetterCallback; + using PropertySetterCallback = Nan::SetterCallback; + using IndexPropertyGetterCallback = Nan::IndexGetterCallback; + using IndexPropertySetterCallback = Nan::IndexSetterCallback; + using StringPropertyGetterCallback = Nan::PropertyGetterCallback; + using StringPropertySetterCallback = Nan::PropertySetterCallback; + using StringPropertyEnumeratorCallback = Nan::PropertyEnumeratorCallback; }; template diff --git a/src/rpc.cpp b/src/rpc.cpp index 3a1afdba92..7c5038b760 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -365,10 +365,10 @@ RPCServer::~RPCServer() { JSGlobalContextRelease(m_context); } -void RPCServer::run_callback(JSContextRef ctx, JSObjectRef function, JSObjectRef this_object, size_t argc, const JSValueRef arguments[], jsc::ReturnValue &return_value) { +JSValueRef RPCServer::run_callback(JSContextRef ctx, JSObjectRef function, JSObjectRef this_object, size_t argc, const JSValueRef arguments[], JSValueRef* exception) { RPCServer* server = get_rpc_server(JSContextGetGlobalContext(ctx)); if (!server) { - return; + return JSValueMakeUndefined(ctx); } u_int64_t counter = server->m_callback_call_counter++; @@ -419,11 +419,15 @@ void RPCServer::run_callback(JSContextRef ctx, JSObjectRef function, JSObjectRef assert(callback_id == resultCallbackId.get()); if (!error.is_null()) { - throw jsc::Exception(ctx, error.get()); + JSStringRef message = JSStringCreateWithUTF8CString(error.get().c_str()); + JSValueRef arguments[] { JSValueMakeString(ctx, message) }; + JSStringRelease(message); + + *exception = JSObjectMakeError(ctx, 1, arguments, nullptr); } - return_value.set(server->deserialize_json_value(results["result"])); + return server->deserialize_json_value(results["result"]); } @@ -649,7 +653,7 @@ JSValueRef RPCServer::deserialize_json_value(const json dict) { RPCObjectID callback_id = value.get(); if (!m_callbacks.count(callback_id)) { - JSObjectRef callback = JSObjectMakeFunctionWithCallback(m_context, nullptr, js::wrap); + JSObjectRef callback = JSObjectMakeFunctionWithCallback(m_context, nullptr, run_callback); m_callbacks.emplace(callback_id, js::Protected(m_context, callback)); m_callback_ids.emplace(callback, callback_id); } diff --git a/src/rpc.hpp b/src/rpc.hpp index f753c4ebf7..490bef1e08 100644 --- a/src/rpc.hpp +++ b/src/rpc.hpp @@ -83,7 +83,7 @@ class RPCServer { RPCWorker m_worker; u_int64_t m_callback_call_counter; - static void run_callback(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], jsc::ReturnValue &); + static JSValueRef run_callback(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef *exception); RPCObjectID store_object(JSObjectRef object); From 281d078523b5ab014ec9caa0cf8e7592d08e8268 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 30 Oct 2018 13:27:33 +0100 Subject: [PATCH 02/26] wrong merge --- src/js_realm.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 4f31f51cef..a40562e1ab 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -820,7 +820,7 @@ void RealmClass::get_sync_session(ContextType ctx, ObjectType object, ReturnV #if REALM_ENABLE_SYNC template -void RealmClass::wait_for_download_completion(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { +void RealmClass::async_open_realm(ContextType ctx, ObjectType this_object, Arguments &args, ReturnValue &return_value) { args.validate_maximum(2); auto callback_function = Value::validated_to_function(ctx, args[0 + (args.count == 2)]); Realm::Config config; From d276fc29e0a4cf642e32767e4ac792b0a443c8ef Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 30 Oct 2018 13:46:21 +0100 Subject: [PATCH 03/26] wrong call --- src/js_realm.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js_realm.hpp b/src/js_realm.hpp index a40562e1ab..6b20560066 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -826,7 +826,7 @@ void RealmClass::async_open_realm(ContextType ctx, ObjectType this_object, Ar Realm::Config config; ObjectDefaultsMap defaults; ConstructorMap constructors; - bool schema_updated = get_realm_config(ctx, this_object, args.count - 1, args.value, config, defaults, constructors); + bool schema_updated = get_realm_config(ctx, this_object, args, config, defaults, constructors); if (!config.sync_config) { throw std::logic_error("_asyncOpen can only be used on a synchronized Realm."); From 601ee117be880a48ede5f1fae27e32c2d0e6fbc8 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 09:25:22 +0100 Subject: [PATCH 04/26] Upgrading to Realm Core v5.12.0 and Realm Sync v3.13.0 --- CHANGELOG.md | 3 +++ dependencies.list | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cf4f75b9a..4fea65bf1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ x.x.x Release notes (yyyy-MM-dd) ============================================================= ### Enhancements * A more meaningful exception will be thrown when trying to refresh the access token for a Realm with an invalid url. Previously, trying to connect to a Realm with a url that lacks the path component (e.g. `realm://foo.com`) would result in errors like `Cannot read property ‘token_data’ of undefined`. Instead, now we'll print out the Realm url and provide a more meaningful exception message. ([#ROS-1310](https://github.com/realm/realm-object-server-private/issues/1310), since v1.0.2) +* Adds support for Node 10. ([#1813](https://github.com/realm/realm-js/issues/1813) and [#2087](https://github.com/realm/realm-js/issues/2087)) ### Fixed * ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?) @@ -14,6 +15,8 @@ x.x.x Release notes (yyyy-MM-dd) ### Internal * Building for iOS can now use the `n` node version manager. Thanks to @SandyChapman! ([#2078](https://github.com/realm/realm-js/pull/2078) +* Upgrading to Realm Core v5.12.0. +* Upgrading to Realm Sync v3.13.0. 2.19.0-rc.4 Release notes (2018-10-17) ============================================================= diff --git a/dependencies.list b/dependencies.list index 4fa59c6c2f..baee298382 100644 --- a/dependencies.list +++ b/dependencies.list @@ -1,5 +1,5 @@ PACKAGE_NAME=realm-js VERSION=2.19.0-rc.4 -REALM_CORE_VERSION=5.10.1 -REALM_SYNC_VERSION=3.10.0 +REALM_CORE_VERSION=5.12.0 +REALM_SYNC_VERSION=3.13.0 REALM_OBJECT_SERVER_VERSION=3.11.1 From cc7548aa898bccbd1ca078481a111d6fcbafe0e0 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 11:39:22 +0100 Subject: [PATCH 05/26] Upgrading to Realm Sync v3.13.1 --- CHANGELOG.md | 2 +- dependencies.list | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fea65bf1e..9620ba4ba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ x.x.x Release notes (yyyy-MM-dd) ### Internal * Building for iOS can now use the `n` node version manager. Thanks to @SandyChapman! ([#2078](https://github.com/realm/realm-js/pull/2078) * Upgrading to Realm Core v5.12.0. -* Upgrading to Realm Sync v3.13.0. +* Upgrading to Realm Sync v3.13.1. 2.19.0-rc.4 Release notes (2018-10-17) ============================================================= diff --git a/dependencies.list b/dependencies.list index baee298382..fcbd356b0a 100644 --- a/dependencies.list +++ b/dependencies.list @@ -1,5 +1,5 @@ PACKAGE_NAME=realm-js VERSION=2.19.0-rc.4 REALM_CORE_VERSION=5.12.0 -REALM_SYNC_VERSION=3.13.0 +REALM_SYNC_VERSION=3.13.1 REALM_OBJECT_SERVER_VERSION=3.11.1 From 7d3ac1933b0b06b43373b0cd85b99f199901e6c1 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 13:49:56 +0100 Subject: [PATCH 06/26] revert back to old get_realm_config() --- package-lock.json | 75 +++++++++++++++++++++++++++-------------------- src/js_realm.hpp | 18 +++++++----- 2 files changed, 53 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b51dc0fed..cea3494eb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -151,9 +151,9 @@ }, "dependencies": { "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", "dev": true } } @@ -181,12 +181,12 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=" }, "are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "integrity": "sha1-SzXClE8GKov82mZBB2A1D+nd/CE=", "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -195,7 +195,7 @@ "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -271,12 +271,12 @@ "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=" }, "babel-eslint": { "version": "8.2.6", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz", - "integrity": "sha512-aCdHjhzcILdP8c9lej7hvXKvQieyRt20SF102SIGyY4cUIiw6UaAtK4j2o3dXX74jEmy0TJ0CEhv4fTIM3SzcA==", + "integrity": "sha1-YnDQxzIFYoBnwPeuFpOp55es79k=", "dev": true, "requires": { "@babel/code-frame": "7.0.0-beta.44", @@ -404,7 +404,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "cli-cursor": { @@ -501,7 +501,7 @@ "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "integrity": "sha1-Sl7Hxk364iw6FBJNus3uhG2Ay8Q=", "dev": true, "requires": { "nice-try": "^1.0.4", @@ -698,7 +698,7 @@ "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "integrity": "sha1-XNAfwQFiG0LEzX9dGmYkNxbT850=", "dev": true, "requires": { "esutils": "^2.0.2" @@ -862,7 +862,7 @@ "eslint-scope": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "integrity": "sha1-UL8wcekzi83EMzF5Sgy1M/ATYXI=", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -1013,13 +1013,13 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", "dev": true }, "esquery": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "integrity": "sha1-QGxRZYsfWZGl+bYrHcJbAOPlxwg=", "dev": true, "requires": { "estraverse": "^4.0.0" @@ -1028,7 +1028,7 @@ "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", "dev": true, "requires": { "estraverse": "^4.1.0" @@ -1049,7 +1049,7 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" }, "extsprintf": { "version": "1.3.0", @@ -1173,7 +1173,18 @@ "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { "asynckit": "^0.4.0", + "combined-stream": "1.0.6", "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + } } }, "fs-extra": { @@ -1189,7 +1200,7 @@ "fs-minipass": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "integrity": "sha1-BsJ3IYRU7CiN93raVKA7hwKqy50=", "requires": { "minipass": "^2.2.1" } @@ -1498,7 +1509,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -1525,7 +1536,7 @@ "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -1574,7 +1585,7 @@ "is-path-in-cwd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "integrity": "sha1-WsSLNF72dTOb1sekipEhELJBz1I=", "dev": true, "requires": { "is-path-inside": "^1.0.0" @@ -1607,7 +1618,7 @@ "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "integrity": "sha1-+xj4fOH+uSUWnJpAfBkxijIG7Yg=", "dev": true }, "is-stream": { @@ -1665,7 +1676,7 @@ "js-yaml": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "integrity": "sha1-6u1lbsg0TxD1J8a/obbiJE3hZ9E=", "dev": true, "requires": { "argparse": "^1.0.7", @@ -2044,7 +2055,7 @@ "node-pre-gyp": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", + "integrity": "sha1-2x8zIVJy9pLNOPAyOOPptHxd0FQ=", "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -2082,7 +2093,7 @@ "npm-bundled": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" + "integrity": "sha1-PBcyt7qTazoQMlrvYWRnwMy8yXk=" }, "npm-packlist": { "version": "1.1.12", @@ -2096,7 +2107,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -2180,7 +2191,7 @@ "osenv": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "integrity": "sha1-hc36+uso6Gd/QW4odZK18/SepBA=", "requires": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -2299,7 +2310,7 @@ "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "integrity": "sha1-zZJL9SAKB1uDwYjNa54hG3/A0+0=", "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -2379,7 +2390,7 @@ "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "integrity": "sha1-nC/KT301tZLv5Xx/ClXoEFIST+8=", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -2927,7 +2938,7 @@ "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", "dev": true, "requires": { "punycode": "^2.1.0" @@ -2936,7 +2947,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", "dev": true } } @@ -2964,7 +2975,7 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=" }, "validate-npm-package-license": { "version": "3.0.1", @@ -3010,7 +3021,7 @@ "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=", "requires": { "string-width": "^1.0.2 || 2" } diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 6b20560066..1e548f1379 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -258,7 +258,7 @@ class RealmClass : public ClassDefinition> { // static methods static void constructor(ContextType, ObjectType, Arguments &); static SharedRealm create_shared_realm(ContextType, realm::Realm::Config, bool, ObjectDefaultsMap &&, ConstructorMap &&); - static bool get_realm_config(ContextType ctx, ObjectType this_object, Arguments &, realm::Realm::Config &, ObjectDefaultsMap &, ConstructorMap &); + static bool get_realm_config(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[], realm::Realm::Config &, ObjectDefaultsMap &, ConstructorMap &); static void schema_version(ContextType, ObjectType, Arguments &, ReturnValue &); static void clear_test_state(ContextType, ObjectType, Arguments &, ReturnValue &); @@ -449,16 +449,18 @@ static inline void convert_outdated_datetime_columns(const SharedRealm &realm) { } template -bool RealmClass::get_realm_config(ContextType ctx, ObjectType this_object, Arguments &args, realm::Realm::Config& config, ObjectDefaultsMap& defaults, ConstructorMap& constructors) { +bool RealmClass::get_realm_config(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[], realm::Realm::Config& config, ObjectDefaultsMap& defaults, ConstructorMap& constructors) { bool schema_updated = false; - args.validate_maximum(1); + if (argc > 1) { + throw std::runtime_error("Invalid arguments when constructing 'Realm'"); + } - if (args.count == 0) { + if (argc == 0) { config.path = default_path(); } - else if (args.count == 1) { - ValueType value = args[0]; + else if (argc == 1) { + ValueType value = arguments[0]; if (Value::is_string(ctx, value)) { config.path = Value::validated_to_string(ctx, value, "path"); } @@ -614,7 +616,7 @@ void RealmClass::constructor(ContextType ctx, ObjectType this_object, Argumen realm::Realm::Config config; ObjectDefaultsMap defaults; ConstructorMap constructors; - bool schema_updated = get_realm_config(ctx, this_object, args, config, defaults, constructors); + bool schema_updated = get_realm_config(ctx, this_object, args.count, args.value, config, defaults, constructors); auto realm = create_shared_realm(ctx, config, schema_updated, std::move(defaults), std::move(constructors)); // Fix for datetime -> timestamp conversion @@ -826,7 +828,7 @@ void RealmClass::async_open_realm(ContextType ctx, ObjectType this_object, Ar Realm::Config config; ObjectDefaultsMap defaults; ConstructorMap constructors; - bool schema_updated = get_realm_config(ctx, this_object, args, config, defaults, constructors); + bool schema_updated = get_realm_config(ctx, this_object, args.count - 1, args.value, config, defaults, constructors); if (!config.sync_config) { throw std::logic_error("_asyncOpen can only be used on a synchronized Realm."); From bd7cb6b2792649bf26ac779cbd9a9dab920def98 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 14:44:26 +0100 Subject: [PATCH 07/26] Location of Linux binaries has changed --- scripts/download-realm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download-realm.js b/scripts/download-realm.js index a8670d6df8..dd2b879b67 100644 --- a/scripts/download-realm.js +++ b/scripts/download-realm.js @@ -48,7 +48,7 @@ function getTempDir() { * conflict. * * It is also possible to overrride this temp directory by setting - * REALM_DOWNLOAD_CORE_TEMP_DIR so, for instance, CI systems will + * REALM_DOWNLOAD_CORE_TEMP_DIR so, for instance, CI systems will * be able to clean up files. */ return process.env.REALM_DOWNLOAD_CORE_TEMP_DIR || @@ -187,7 +187,7 @@ function getCoreRequirements(dependencies, options, required = {}) { } case 'linux': required.CORE_SERVER_FOLDER = 'core'; - required.CORE_ARCHIVE = `realm-core-${dependencies.REALM_CORE_VERSION}.tgz`; + required.CORE_ARCHIVE = `realm-core-${flavor}-${dependencies.REALM_CORE_VERSION}-Linux-devel.tar.gz`; required.CORE_ARCHIVE_ROOT = `realm-core-${dependencies.REALM_CORE_VERSION}`; return Promise.resolve(required); default: From f3b1145ac3d2d3395415d4152444d6c2e557caac Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 14:53:22 +0100 Subject: [PATCH 08/26] wip --- scripts/download-realm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download-realm.js b/scripts/download-realm.js index dd2b879b67..141659b2fa 100644 --- a/scripts/download-realm.js +++ b/scripts/download-realm.js @@ -187,7 +187,7 @@ function getCoreRequirements(dependencies, options, required = {}) { } case 'linux': required.CORE_SERVER_FOLDER = 'core'; - required.CORE_ARCHIVE = `realm-core-${flavor}-${dependencies.REALM_CORE_VERSION}-Linux-devel.tar.gz`; + required.CORE_ARCHIVE = `realm-core-${flavor}-v${dependencies.REALM_CORE_VERSION}-Linux-devel.tar.gz`; required.CORE_ARCHIVE_ROOT = `realm-core-${dependencies.REALM_CORE_VERSION}`; return Promise.resolve(required); default: From a3ea53977de15b1ab4ec63193eb1e16c52c7e95e Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 15:20:41 +0100 Subject: [PATCH 09/26] downloaded files might have multiple . --- scripts/download-realm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download-realm.js b/scripts/download-realm.js index 141659b2fa..9e6159daf8 100644 --- a/scripts/download-realm.js +++ b/scripts/download-realm.js @@ -129,7 +129,7 @@ function extract(downloadedArchive, targetFolder, archiveRootFolder) { if (!archiveRootFolder) { return decompress(downloadedArchive, targetFolder); } else { - const tempExtractLocation = path.resolve(getTempDir(), path.basename(downloadedArchive, path.extname(downloadedArchive))); + const tempExtractLocation = path.resolve(getTempDir(), path.basename(downloadedArchive).replace(/(\.[^/.]+)+$/, "")); return decompress(downloadedArchive, tempExtractLocation) .then(() => fs.readdir(path.resolve(tempExtractLocation, archiveRootFolder))) .then(items => Promise.all(items.map(item => { From 002feb770ab6e8f8ea0d00f436567a6aeef272b8 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 15:31:04 +0100 Subject: [PATCH 10/26] only the last two . --- scripts/download-realm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/download-realm.js b/scripts/download-realm.js index 9e6159daf8..c5817801bf 100644 --- a/scripts/download-realm.js +++ b/scripts/download-realm.js @@ -129,7 +129,8 @@ function extract(downloadedArchive, targetFolder, archiveRootFolder) { if (!archiveRootFolder) { return decompress(downloadedArchive, targetFolder); } else { - const tempExtractLocation = path.resolve(getTempDir(), path.basename(downloadedArchive).replace(/(\.[^/.]+)+$/, "")); + const base = path.basename(downloadedArchive).split('.'); + const tempExtractLocation = path.resolve(getTempDir(), base.slice(0, base.length - 2).join('.')); return decompress(downloadedArchive, tempExtractLocation) .then(() => fs.readdir(path.resolve(tempExtractLocation, archiveRootFolder))) .then(items => Promise.all(items.map(item => { From d88e589c37bcb59f6df686178aa5c789f82243cc Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Thu, 1 Nov 2018 18:57:19 +0100 Subject: [PATCH 11/26] wip --- scripts/download-realm.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/download-realm.js b/scripts/download-realm.js index c5817801bf..2f8ae9d2b0 100644 --- a/scripts/download-realm.js +++ b/scripts/download-realm.js @@ -189,7 +189,6 @@ function getCoreRequirements(dependencies, options, required = {}) { case 'linux': required.CORE_SERVER_FOLDER = 'core'; required.CORE_ARCHIVE = `realm-core-${flavor}-v${dependencies.REALM_CORE_VERSION}-Linux-devel.tar.gz`; - required.CORE_ARCHIVE_ROOT = `realm-core-${dependencies.REALM_CORE_VERSION}`; return Promise.resolve(required); default: return Promise.reject(new Error(`Unsupported core platform '${options.platform}'`)); From 266e951c92aa5c449e8befa78fb5942150fd104c Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Fri, 2 Nov 2018 09:56:11 +0100 Subject: [PATCH 12/26] Link with version.lib on Windows --- realm.gypi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/realm.gypi b/realm.gypi index 072bcf0000..e0d0f40c9f 100644 --- a/realm.gypi +++ b/realm.gypi @@ -201,6 +201,11 @@ "dependencies": [ "realm-core" ], "link_settings": { "libraries": [ "-lrealm-sync<(debug_library_suffix)" ], + "conditions": [ + ["OS=='win'", { + "libraries": [ "version.lib" ] + }] + ] }, "all_dependent_settings": { "defines": [ "REALM_ENABLE_SYNC=1" ] From 9a67987928716fe0f17a8b5c00cccbffad1b42cd Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Sat, 3 Nov 2018 12:09:45 +0100 Subject: [PATCH 13/26] Include openssl --- realm.gypi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/realm.gypi b/realm.gypi index e0d0f40c9f..805b462d47 100644 --- a/realm.gypi +++ b/realm.gypi @@ -198,7 +198,7 @@ { "target_name": "realm-sync", "type": "none", - "dependencies": [ "realm-core" ], + "dependencies": [ "realm-core", "OpenSSL" ], "link_settings": { "libraries": [ "-lrealm-sync<(debug_library_suffix)" ], "conditions": [ @@ -244,7 +244,8 @@ }], ["OS=='linux'", { "libraries": [ "-l:libssl.a", "-l:libcrypto.a" ], - "library_dirs": [ "/usr/lib", "/usr/lib64" ], + "library_dirs": [ "/usr/lib", "/usr/lib64" ], + "type": "static_library", }] ] } From 8877e312772f9c7c064874aabb64a21293ec5f64 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Mon, 5 Nov 2018 14:34:01 +0100 Subject: [PATCH 14/26] wip --- realm.gypi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/realm.gypi b/realm.gypi index 805b462d47..caeb1fe678 100644 --- a/realm.gypi +++ b/realm.gypi @@ -30,7 +30,6 @@ "targets": [ { "target_name": "object-store", - "dependencies": [ "realm-core" ], "type": "static_library", "include_dirs": [ "src/object-store/src", @@ -151,6 +150,8 @@ "src/object-store/src/sync/impl/sync_metadata.cpp", "src/object-store/src/sync/impl/work_queue.cpp" ], + }, { + "dependencies": [ "realm-core" ] }] ], "all_dependent_settings": { @@ -169,6 +170,7 @@ { "target_name": "realm-core", "type": "none", + "dependencies": [ "OpenSSL" ], "direct_dependent_settings": { "conditions": [ ["use_realm_debug", { @@ -198,7 +200,7 @@ { "target_name": "realm-sync", "type": "none", - "dependencies": [ "realm-core", "OpenSSL" ], + "dependencies": [ "realm-core" ], "link_settings": { "libraries": [ "-lrealm-sync<(debug_library_suffix)" ], "conditions": [ @@ -244,8 +246,7 @@ }], ["OS=='linux'", { "libraries": [ "-l:libssl.a", "-l:libcrypto.a" ], - "library_dirs": [ "/usr/lib", "/usr/lib64" ], - "type": "static_library", + "library_dirs": [ "/usr/lib", "/usr/lib64" ], }] ] } From 7c50e50cabb6f07737651d26c8c12e3b984fbd83 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Mon, 5 Nov 2018 15:02:28 +0100 Subject: [PATCH 15/26] wip --- realm.gypi | 1 - 1 file changed, 1 deletion(-) diff --git a/realm.gypi b/realm.gypi index caeb1fe678..fd38e788cf 100644 --- a/realm.gypi +++ b/realm.gypi @@ -170,7 +170,6 @@ { "target_name": "realm-core", "type": "none", - "dependencies": [ "OpenSSL" ], "direct_dependent_settings": { "conditions": [ ["use_realm_debug", { From 6faff1b7fb87b4e43d5406d83d463fcc907d7291 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 09:52:38 +0100 Subject: [PATCH 16/26] use mincore.lib --- realm.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/realm.gypi b/realm.gypi index fd38e788cf..8b549be877 100644 --- a/realm.gypi +++ b/realm.gypi @@ -204,7 +204,7 @@ "libraries": [ "-lrealm-sync<(debug_library_suffix)" ], "conditions": [ ["OS=='win'", { - "libraries": [ "version.lib" ] + "libraries": [ "Mincore.lib" ] }] ] }, From 9857307d82538f0bdf8c74174373163b2e8abec9 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 11:18:00 +0100 Subject: [PATCH 17/26] Use absolute path for mincore --- realm.gypi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/realm.gypi b/realm.gypi index 8b549be877..16a9ffd4ae 100644 --- a/realm.gypi +++ b/realm.gypi @@ -204,7 +204,13 @@ "libraries": [ "-lrealm-sync<(debug_library_suffix)" ], "conditions": [ ["OS=='win'", { - "libraries": [ "Mincore.lib" ] + "conditions": [ + ["target_arch=='ia32'", { + "libraries": [ "C:\\Program\ Files\ (x86)\\Windows\ Kits\\8.1\\Lib\\winv6.3\\um\\x86\\mincore.lib" ] + }, { + "libraries": [ "C:\\Program\ Files\ (x64)\\Windows\ Kits\\8.1\\Lib\\winv6.3\\um\\x64\\mincore.lib" ] + }] + ] }] ] }, From b88064af57c8fcb0ad9b66fd14a91d81c2fe911c Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 11:31:40 +0100 Subject: [PATCH 18/26] No slashes --- realm.gypi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/realm.gypi b/realm.gypi index 16a9ffd4ae..916a008a23 100644 --- a/realm.gypi +++ b/realm.gypi @@ -206,9 +206,9 @@ ["OS=='win'", { "conditions": [ ["target_arch=='ia32'", { - "libraries": [ "C:\\Program\ Files\ (x86)\\Windows\ Kits\\8.1\\Lib\\winv6.3\\um\\x86\\mincore.lib" ] + "libraries": [ "C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x86\\mincore.lib" ] }, { - "libraries": [ "C:\\Program\ Files\ (x64)\\Windows\ Kits\\8.1\\Lib\\winv6.3\\um\\x64\\mincore.lib" ] + "libraries": [ "C:\\Program Files (x64)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x64\\mincore.lib" ] }] ] }] From b1294448cc0dcf8c1fb28ad6f347995d9dfaf73e Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 11:47:52 +0100 Subject: [PATCH 19/26] wip --- realm.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/realm.gypi b/realm.gypi index 916a008a23..d68c1db4a7 100644 --- a/realm.gypi +++ b/realm.gypi @@ -208,7 +208,7 @@ ["target_arch=='ia32'", { "libraries": [ "C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x86\\mincore.lib" ] }, { - "libraries": [ "C:\\Program Files (x64)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x64\\mincore.lib" ] + "libraries": [ "C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x64\\mincore.lib" ] }] ] }] From bd2d4b3118c346b8757ae32b276aeb8305fe692a Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 12:05:34 +0100 Subject: [PATCH 20/26] Use absolute path for ssleay32 --- realm.gypi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/realm.gypi b/realm.gypi index d68c1db4a7..6e4aa6db0d 100644 --- a/realm.gypi +++ b/realm.gypi @@ -240,12 +240,11 @@ "link_settings": { "conditions": [ ["OS=='win'", { - "libraries": [ "libeay32.lib", "ssleay32.lib" ], "conditions": [ ["target_arch=='ia32'", { - "library_dirs": [ "C:\\src\\vcpkg\\installed\\x86-windows-static\\lib" ] + "libraries": [ "C:\\src\\vcpkg\\installed\\x86-windows-static\\lib\\libeay32.lib", "C:\\src\\vcpkg\\installed\\x86-windows-static\\lib\\ssleay32.lib" ] }, { - "library_dirs": [ "C:\\src\\vcpkg\\installed\\x64-windows-static\\lib" ] + "libraries": [ "C:\\src\\vcpkg\\installed\\x64-windows-static\\lib\\libeay32.lib", "C:\\src\\vcpkg\\installed\\x64-windows-static\\lib\\ssleay32.lib" ] }], ] }], From d54debf12bd36b64348d4007a2c4b71b70c50d88 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 12:50:16 +0100 Subject: [PATCH 21/26] Add SSL dependencies to windows build --- binding.gyp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 4af696c89f..370fed26e2 100644 --- a/binding.gyp +++ b/binding.gyp @@ -48,7 +48,10 @@ "conditions": [ ["runtime=='electron'", { "dependencies": [ "OpenSSL" ] - }] + }], + ["OS=='win'", { + "dependencies": [ "OpenSSL" ] + }], ] }, { From cdc52d5bf9ba7b63798b42b277c71fd56e136fe5 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Tue, 6 Nov 2018 15:52:21 +0100 Subject: [PATCH 22/26] Only use node 6, 8, and 10 in pre-gyp --- CHANGELOG.md | 2 +- packaging/node-pre-gyp/base-image/Dockerfile | 9 ++++----- scripts/build-node-pre-gyp.sh | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9620ba4ba9..469c617dcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ x.x.x Release notes (yyyy-MM-dd) ============================================================= ### Enhancements * A more meaningful exception will be thrown when trying to refresh the access token for a Realm with an invalid url. Previously, trying to connect to a Realm with a url that lacks the path component (e.g. `realm://foo.com`) would result in errors like `Cannot read property ‘token_data’ of undefined`. Instead, now we'll print out the Realm url and provide a more meaningful exception message. ([#ROS-1310](https://github.com/realm/realm-object-server-private/issues/1310), since v1.0.2) -* Adds support for Node 10. ([#1813](https://github.com/realm/realm-js/issues/1813) and [#2087](https://github.com/realm/realm-js/issues/2087)) +* Adds support for Node 10. Pre-gyp'ed binaries are avaiable for Node 6, 8, and 10. ([#1813](https://github.com/realm/realm-js/issues/1813) and [#2087](https://github.com/realm/realm-js/issues/2087)) ### Fixed * ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?) diff --git a/packaging/node-pre-gyp/base-image/Dockerfile b/packaging/node-pre-gyp/base-image/Dockerfile index fa8b028328..b80237c0a0 100644 --- a/packaging/node-pre-gyp/base-image/Dockerfile +++ b/packaging/node-pre-gyp/base-image/Dockerfile @@ -18,7 +18,7 @@ RUN touch /var/lib/rpm/* \ && yum -y install \ python27 \ which \ - chrpath \ + chrpath \:q openssl-devel \ devtoolset-6-gcc \ devtoolset-6-gcc-c++ \ @@ -31,7 +31,6 @@ RUN touch /var/lib/rpm/* \ ENV NVM_DIR /root/.nvm RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash RUN . $NVM_DIR/nvm.sh && \ - nvm install 4.4.7 && \ - nvm install 5.12.0 && \ - nvm install 6.5.0 && \ - nvm install 7.0.0 + nvm install 6.14.4 && \ + nvm install 8.12.0 && \ + nvm install 10.13.0 diff --git a/scripts/build-node-pre-gyp.sh b/scripts/build-node-pre-gyp.sh index f787bd9816..c65a91164c 100755 --- a/scripts/build-node-pre-gyp.sh +++ b/scripts/build-node-pre-gyp.sh @@ -1,6 +1,6 @@ #!/bin/bash -node_versions=${@:-4.4.7 5.12.0 6.5.0 7.0.0} +node_versions=${@:-6.14.4 8.12.0 10.13.0} topdir=$(cd $(dirname "$0")/..; pwd) @@ -36,7 +36,6 @@ for node_version in ${node_versions}; do nvm use ${node_version} || die "Could not load nodejs v${node_version}" npm install --build-from-source=realm "$EXTRA_NPM_ARGUMENTS" || die "Could not build module" - #./scripts/test.sh node || die "Unit tests for nodejs v${node_version} failed" ./node_modules/.bin/node-pre-gyp package || die "Could not package module" cp build/stage/node-pre-gyp/*.tar.gz ${topdir}/out/ ) From ae5455431b563552051506d8ea95bda3ba900b72 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Wed, 7 Nov 2018 08:49:48 +0100 Subject: [PATCH 23/26] Update pre-gyp script for Windows --- scripts/build-node-pre-gyp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-node-pre-gyp.ps1 b/scripts/build-node-pre-gyp.ps1 index ee738f4521..307216e804 100644 --- a/scripts/build-node-pre-gyp.ps1 +++ b/scripts/build-node-pre-gyp.ps1 @@ -20,7 +20,7 @@ New-Item .\out -ItemType "directory" npm install --ignore-scripts foreach ($arch in "ia32", "x64") { - foreach ($version in "4.0.0", "5.0.0", "6.0.0", "7.0.0", "8.0.0") { + foreach ($version in "6.14.4", "8.12.0", "10.13.0") { Remove-Item .\build, .\compiled -Recurse -Force -ErrorAction Ignore .\node_modules\node-pre-gyp\bin\node-pre-gyp.cmd rebuild --target_arch=$arch --target=$version .\node_modules\node-pre-gyp\bin\node-pre-gyp.cmd package --target_arch=$arch --target=$version From 2e85536fe61bcbeb333938d763ec4348c1992047 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Wed, 7 Nov 2018 08:50:15 +0100 Subject: [PATCH 24/26] [2.19.0-rc.5] Bump version --- CHANGELOG.md | 2 +- dependencies.list | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 469c617dcd..447cfb2833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -x.x.x Release notes (yyyy-MM-dd) +2.19.0 Release notes (2018-11-7) ============================================================= ### Enhancements * A more meaningful exception will be thrown when trying to refresh the access token for a Realm with an invalid url. Previously, trying to connect to a Realm with a url that lacks the path component (e.g. `realm://foo.com`) would result in errors like `Cannot read property ‘token_data’ of undefined`. Instead, now we'll print out the Realm url and provide a more meaningful exception message. ([#ROS-1310](https://github.com/realm/realm-object-server-private/issues/1310), since v1.0.2) diff --git a/dependencies.list b/dependencies.list index fcbd356b0a..12d57ae5fa 100644 --- a/dependencies.list +++ b/dependencies.list @@ -1,5 +1,5 @@ PACKAGE_NAME=realm-js -VERSION=2.19.0-rc.4 +VERSION=2.19.0-rc.5 REALM_CORE_VERSION=5.12.0 REALM_SYNC_VERSION=3.13.1 REALM_OBJECT_SERVER_VERSION=3.11.1 diff --git a/package.json b/package.json index d2d96980d9..9eeb5a7b28 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "realm", "description": "Realm is a mobile database: an alternative to SQLite and key-value stores", - "version": "2.19.0-rc.4", + "version": "2.19.0-rc.5", "license": "See the actual license in the file LICENSE", "homepage": "https://realm.io", "keywords": [ From f10dafb49563a87cb780ff34d8dbbfeb3a081ed5 Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Wed, 7 Nov 2018 10:08:58 +0100 Subject: [PATCH 25/26] Adding changelog template --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 447cfb2833..04f6fb374e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +x.x.x Release notes (yyyy-MM-dd) +============================================================= +### Enhancements +* None. + +### Fixed +* ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?) +* None. + +### Compatibility +* Realm Object Server: 3.11.0 or later. +* APIs are backwards compatible with all previous release of realm in the 2.x.y series. +* File format: Generates Realms with format v9 (Reads and upgrades all previous formats) + + ### Internal +* None. + 2.19.0 Release notes (2018-11-7) ============================================================= ### Enhancements From c1d991d2323ad5d7ba7b3f321d9f42ba3b91a5cb Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Wed, 7 Nov 2018 10:18:44 +0100 Subject: [PATCH 26/26] PR feedback --- CHANGELOG.md | 5 ++--- packaging/node-pre-gyp/base-image/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04f6fb374e..9d955a0ced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,10 +19,9 @@ x.x.x Release notes (yyyy-MM-dd) ============================================================= ### Enhancements * A more meaningful exception will be thrown when trying to refresh the access token for a Realm with an invalid url. Previously, trying to connect to a Realm with a url that lacks the path component (e.g. `realm://foo.com`) would result in errors like `Cannot read property ‘token_data’ of undefined`. Instead, now we'll print out the Realm url and provide a more meaningful exception message. ([#ROS-1310](https://github.com/realm/realm-object-server-private/issues/1310), since v1.0.2) -* Adds support for Node 10. Pre-gyp'ed binaries are avaiable for Node 6, 8, and 10. ([#1813](https://github.com/realm/realm-js/issues/1813) and [#2087](https://github.com/realm/realm-js/issues/2087)) +* Adds support for Node 10. Pre-gyp'ed binaries are available for Node 6, 8, and 10. ([#1813](https://github.com/realm/realm-js/issues/1813) and [#2087](https://github.com/realm/realm-js/issues/2087)) ### Fixed -* ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?) * None. ### Compatibility @@ -31,7 +30,7 @@ x.x.x Release notes (yyyy-MM-dd) * File format: Generates Realms with format v9 (Reads and upgrades all previous formats) ### Internal -* Building for iOS can now use the `n` node version manager. Thanks to @SandyChapman! ([#2078](https://github.com/realm/realm-js/pull/2078) +* Building for iOS can now use the `n` node version manager. Thanks to @SandyChapman! ([#2078](https://github.com/realm/realm-js/pull/2078)) * Upgrading to Realm Core v5.12.0. * Upgrading to Realm Sync v3.13.1. diff --git a/packaging/node-pre-gyp/base-image/Dockerfile b/packaging/node-pre-gyp/base-image/Dockerfile index b80237c0a0..ae8169d0cc 100644 --- a/packaging/node-pre-gyp/base-image/Dockerfile +++ b/packaging/node-pre-gyp/base-image/Dockerfile @@ -18,7 +18,7 @@ RUN touch /var/lib/rpm/* \ && yum -y install \ python27 \ which \ - chrpath \:q + chrpath \ openssl-devel \ devtoolset-6-gcc \ devtoolset-6-gcc-c++ \