From 2f790457005f00199c1a2dc3a706b44aa60ca77c Mon Sep 17 00:00:00 2001 From: jaredwy Date: Thu, 27 Apr 2017 17:54:22 +1000 Subject: [PATCH 1/2] Update to use bigint library to be able to properly display greater than 2^53 --- bower.json | 3 ++- static/compiler.js | 15 +++++++++++---- static/main.js | 1 + static/output.js | 1 - static/sharing.js | 6 ------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/bower.json b/bower.json index 8d9d03577..6911de9f4 100644 --- a/bower.json +++ b/bower.json @@ -28,6 +28,7 @@ "raven-js": "^3.10.0", "es6-promise": "^4.0.5", "lru-cache": "2.7.3", - "seiyria-bootstrap-slider": "9.7.x" + "seiyria-bootstrap-slider": "9.7.x", + "big-integer": "https://github.com/peterolson/BigInteger.js.git#^1.6.22" } } diff --git a/static/compiler.js b/static/compiler.js index b0f8d5af7..6cc14ed27 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -36,6 +36,7 @@ define(function (require) { var LruCache = require('lru-cache'); var monaco = require('monaco'); var Alert = require('alert'); + var bigInt = require('big-integer'); require('asm-mode'); require('selectize'); @@ -209,7 +210,7 @@ define(function (require) { }, this)); this.container.layoutManager.createDragSource( - this.domRoot.optButton, createOptView.bind(this)); + this.optButton, createOptView.bind(this)); this.optButton.click(_.bind(function () { var insertPoint = hub.findParentRowOrColumn(this.container) || @@ -593,9 +594,15 @@ define(function (require) { function getNumericToolTip(value) { var match = hexLike.exec(value); - if (match) return value + ' = ' + parseInt(match[2], 16).toString(); - match = decimalLike.exec(value); - if (match) return value + ' = 0x' + parseInt(match[2]).toString(16); + if (match) + { + return value + ' = ' + bigInt(match[2], 16).toString(10); + } + match = decimalLike.exec(value); + if (match) { + return value + ' = 0x' + bigInt(match[2]).toString(16).toUpperCase(); + } + return null; } diff --git a/static/main.js b/static/main.js index 1db22e738..9deeabdf1 100644 --- a/static/main.js +++ b/static/main.js @@ -35,6 +35,7 @@ require.config({ events: 'ext/eventEmitter/EventEmitter', lzstring: 'ext/lz-string/libs/lz-string', clipboard: 'ext/clipboard/dist/clipboard', + 'big-integer': 'ext/big-integer/BigInteger.min', 'raven-js': 'ext/raven-js/dist/raven', 'es6-promise': 'ext/es6-promise/es6-promise', 'lru-cache': 'ext/lru-cache/lib/lru-cache', diff --git a/static/output.js b/static/output.js index 156a9dc34..99eb12491 100644 --- a/static/output.js +++ b/static/output.js @@ -30,7 +30,6 @@ define(function (require) { var FontScale = require('fontscale'); function Output(hub, container, state) { - var self = this; this.container = container; this.compilerId = state.compiler; this.editorId = state.editor; diff --git a/static/sharing.js b/static/sharing.js index 7db01d2d6..afaf5713e 100644 --- a/static/sharing.js +++ b/static/sharing.js @@ -62,12 +62,6 @@ define(function (require) { } } - function getItemsByComponent(layout, component) { - return layout.root.getItemsByFilter(function (o) { - return o.type === "component" && o.componentName === component; - }); - } - function getEmbeddedUrl(layout, readOnly) { var location = window.location.origin + window.location.pathname; if (location[location.length - 1] !== '/') location += '/'; From 9a670c5590618f0989a8506a130e6307730cc5d7 Mon Sep 17 00:00:00 2001 From: jaredwy Date: Sat, 29 Apr 2017 10:16:40 +1000 Subject: [PATCH 2/2] Updating the brace style to be consistent --- static/compiler.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/compiler.js b/static/compiler.js index 5fc749509..18a77b4fc 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -620,8 +620,7 @@ define(function (require) { function getNumericToolTip(value) { var match = hexLike.exec(value); - if (match) - { + if (match) { return value + ' = ' + bigInt(match[2], 16).toString(10); } match = decimalLike.exec(value);