diff --git a/accessible/README b/accessible/README
index 37ea67879..42bf1c4fa 100644
--- a/accessible/README
+++ b/accessible/README
@@ -33,20 +33,23 @@ To customize the toolbar, you will need to declare an ACCESSIBLE_GLOBALS object
in the global scope that looks like this:
var ACCESSIBLE_GLOBALS = {
- toolbarButtonConfig: [],
- mediaPathPrefix: null
+ mediaPathPrefix: null,
+ toolbarButtonConfig: []
};
-The value corresponding to 'toolbarButtonConfig' can be modified by adding
-objects representing buttons on the toolbar. Each of these objects should have
-two keys:
+The value of mediaPathPrefix should be the location of the accessible/media
+folder.
+
+The value of 'toolbarButtonConfig' should be a list of objects, each
+representing buttons on the toolbar. Each of these objects should have four
+keys:
- 'text' (the text to display on the button)
+ - 'ariaDescribedBy' (the value of the button's aria-describedby attribute)
+ - 'isHidden' (a function that returns true if the button should not be
+ displayed, and false otherwise)
- 'action' (the function that gets run when the button is clicked)
-In addition, if you want audio to be played, set mediaPathPrefix to the
-location of the accessible/media folder.
-
Limitations
-----------
diff --git a/accessible/app.component.js b/accessible/app.component.js
index e1c4329d3..42d04608e 100644
--- a/accessible/app.component.js
+++ b/accessible/app.component.js
@@ -32,16 +32,11 @@ blocklyApp.AppView = ng.core
Status: {{getStatusMessage()}}
-
-
-
- {{'TOOLBOX_LOAD'|translate}}
-
-
- {{'WORKSPACE_LOAD'|translate}}
-
-
-
+
+
+ {{'TOOLBOX_LOAD'|translate}}
+ {{'WORKSPACE_LOAD'|translate}}
+
{{'ARGUMENT_INPUT'|translate}}
diff --git a/accessible/clipboard.service.js b/accessible/clipboard.service.js
index 05b0afe63..9a7e7451a 100644
--- a/accessible/clipboard.service.js
+++ b/accessible/clipboard.service.js
@@ -106,10 +106,14 @@ blocklyApp.ClipboardService = ng.core
},
copy: function(block) {
this.clipboardBlockXml_ = Blockly.Xml.blockToDom(block);
+ Blockly.Xml.deleteNext(this.clipboardBlockXml_);
this.clipboardBlockPreviousConnection_ = block.previousConnection;
this.clipboardBlockNextConnection_ = block.nextConnection;
this.clipboardBlockOutputConnection_ = block.outputConnection;
},
+ isClipboardEmpty: function() {
+ return !this.clipboardBlockXml_;
+ },
pasteFromClipboard: function(inputConnection) {
var connection = inputConnection;
// If the connection is a 'previousConnection' and that connection is
diff --git a/accessible/field.component.js b/accessible/field.component.js
index e10323db7..5a5302960 100644
--- a/accessible/field.component.js
+++ b/accessible/field.component.js
@@ -30,12 +30,12 @@ blocklyApp.FieldComponent = ng.core
template: `
@@ -44,7 +44,8 @@ blocklyApp.FieldComponent = ng.core
+ [attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap[optionValue + 'Button'], 'blockly-button')"
+ [attr.aria-level]="level" [attr.aria-selected]="field.getValue() == optionValue">
@@ -62,7 +63,7 @@ blocklyApp.FieldComponent = ng.core
{{field.getText()}}
`,
- inputs: ['field', 'index', 'parentId', 'disabled', 'mainFieldId'],
+ inputs: ['field', 'index', 'parentId', 'disabled', 'mainFieldId', 'level'],
pipes: [blocklyApp.TranslatePipe]
})
.Class({
@@ -78,6 +79,10 @@ blocklyApp.FieldComponent = ng.core
// this.generateElementNames() are unique.
this.idMap = this.utilsService.generateIds(elementsNeedingIds);
},
+ setNumberValue: function(newValue) {
+ // Do not permit a residual value of NaN after a backspace event.
+ this.field.setValue(newValue || 0);
+ },
generateAriaLabelledByAttr: function(mainLabel, secondLabel) {
return mainLabel + ' ' + secondLabel;
},
diff --git a/accessible/media/accessible.css b/accessible/media/accessible.css
index 5a68527ca..3d88b87ad 100644
--- a/accessible/media/accessible.css
+++ b/accessible/media/accessible.css
@@ -1,6 +1,17 @@
-.blocklyTable {
- vertical-align: top;
+.blocklyToolboxColumn {
+ float: left;
+ width: 350px;
}
+.blocklyWorkspaceColumn {
+ float: left;
+ width: 350px;
+}
+.blocklyToolbarColumn {
+ float: left;
+ margin-top: 20px;
+ width: 200px;
+}
+
.blocklyTree .blocklyActiveDescendant > label,
.blocklyTree .blocklyActiveDescendant > div > label,
.blocklyActiveDescendant > button,
diff --git a/accessible/messages.js b/accessible/messages.js
index 681b5d535..af3a871ac 100644
--- a/accessible/messages.js
+++ b/accessible/messages.js
@@ -70,4 +70,4 @@ Blockly.Msg.BLOCK_MOVED_TO_MARKED_SPOT_MSB = 'Block moved to marked spot: ';
Blockly.Msg.TOOLBOX_BLOCK = 'toolbox block';
Blockly.Msg.WORKSPACE_BLOCK = 'workspace block';
Blockly.Msg.SUBMENU_INDICATOR = 'move right to view submenu';
-Blockly.Msg.MORE_OPTIONS = 'More options';
+Blockly.Msg.BLOCK_OPTIONS = 'Block options';
diff --git a/accessible/toolbox-tree.component.js b/accessible/toolbox-tree.component.js
index e5bbb75be..18d8b1fb2 100644
--- a/accessible/toolbox-tree.component.js
+++ b/accessible/toolbox-tree.component.js
@@ -28,48 +28,35 @@ blocklyApp.ToolboxTreeComponent = ng.core
.Component({
selector: 'blockly-toolbox-tree',
template: `
-
{{getBlockDescription()}}
-
-
- {{'COPY_TO_WORKSPACE'|translate}}
-
-
-
-
- {{'COPY_TO_CLIPBOARD'|translate}}
-
-
-
+ [attr.aria-level]="level + 1">
{{'COPY_TO_MARKED_SPOT'|translate}}
+
+
+ {{'COPY_TO_WORKSPACE'|translate}}
+
+
-
-
-
`,
directives: [blocklyApp.FieldComponent, ng.core.forwardRef(function() {
return blocklyApp.ToolboxTreeComponent;
})],
inputs: [
- 'block', 'displayBlockMenu', 'level', 'index', 'tree', 'noCategories', 'isTopLevel'],
+ 'block', 'displayBlockMenu', 'level', 'tree', 'isFirstToolboxTree'],
pipes: [blocklyApp.TranslatePipe]
})
.Class({
@@ -85,19 +72,34 @@ blocklyApp.ToolboxTreeComponent = ng.core
this.utilsService = _utilsService;
}],
ngOnInit: function() {
- var elementsNeedingIds = ['blockSummaryLabel'];
+ var idKeys = ['toolboxBlockRoot', 'blockSummaryLabel'];
if (this.displayBlockMenu) {
- elementsNeedingIds = elementsNeedingIds.concat(['blockSummarylabel',
- 'workspaceCopy', 'workspaceCopyButton', 'blockCopy',
- 'blockCopyButton', 'sendToSelected', 'sendToSelectedButton']);
+ idKeys = idKeys.concat([
+ 'workspaceCopy', 'workspaceCopyButton', 'sendToSelected',
+ 'sendToSelectedButton']);
}
- this.idMap = this.utilsService.generateIds(elementsNeedingIds);
- if (this.isTopLevel) {
- this.idMap['parentList'] = 'blockly-toolbox-tree-node0';
- } else {
- this.idMap['parentList'] = this.utilsService.generateUniqueId();
+
+ this.idMap = {};
+ for (var i = 0; i < idKeys.length; i++) {
+ this.idMap[idKeys[i]] = this.block.id + idKeys[i];
}
},
+ ngAfterViewInit: function() {
+ // If this is the first tree in the category-less toolbox, set its active
+ // descendant after the ids have been computed.
+ // Note that a timeout is needed here in order to trigger Angular
+ // change detection.
+ if (this.isFirstToolboxTree) {
+ var that = this;
+ setTimeout(function() {
+ that.treeService.setActiveDesc(
+ that.idMap['toolboxBlockRoot'], 'blockly-toolbox-tree');
+ });
+ }
+ },
+ isWorkspaceEmpty: function() {
+ return this.utilsService.isWorkspaceEmpty();
+ },
getBlockDescription: function() {
return this.utilsService.getBlockDescription(this.block);
},
@@ -117,15 +119,10 @@ blocklyApp.ToolboxTreeComponent = ng.core
setTimeout(function() {
that.treeService.focusOnBlock(newBlockId);
that.notificationsService.setStatusMessage(
- blockDescription + ' copied to workspace. ' +
+ blockDescription + ' copied to new workspace group. ' +
'Now on copied block in workspace.');
});
},
- copyToClipboard: function() {
- this.clipboardService.copy(this.block);
- this.notificationsService.setStatusMessage(
- this.getBlockDescription() + ' ' + Blockly.Msg.COPIED_BLOCK_MSG);
- },
copyToMarkedSpot: function() {
var blockDescription = this.getBlockDescription();
// Clean up the active desc for the destination tree.
diff --git a/accessible/toolbox.component.js b/accessible/toolbox.component.js
index a7d5acd93..fd81d0f43 100644
--- a/accessible/toolbox.component.js
+++ b/accessible/toolbox.component.js
@@ -27,44 +27,45 @@ blocklyApp.ToolboxComponent = ng.core
.Component({
selector: 'blockly-toolbox',
template: `
-
- 0" tabindex="0"
- [attr.aria-labelledby]="toolboxTitle.id"
- [attr.aria-activedescendant]="getActiveDescId()"
- (keydown)="treeService.onKeypress($event, tree)">
-
-
-
-
- {{category.attributes.name.value}}
-
-
0">
-
-
-
-
-
-
-
-
-
-
-
+
`,
directives: [blocklyApp.ToolboxTreeComponent]
})
@@ -73,7 +74,6 @@ blocklyApp.ToolboxComponent = ng.core
blocklyApp.TreeService, blocklyApp.UtilsService,
function(_treeService, _utilsService) {
this.toolboxCategories = [];
- this.toolboxWorkspaces = Object.create(null);
this.treeService = _treeService;
this.utilsService = _utilsService;
@@ -125,24 +125,6 @@ blocklyApp.ToolboxComponent = ng.core
'Move right to access ' + numBlocks + ' blocks in this category.';
},
getToolboxWorkspace: function(categoryNode) {
- if (categoryNode.attributes && categoryNode.attributes.name) {
- var categoryName = categoryNode.attributes.name.value;
- } else {
- var categoryName = 'no-category';
- }
- if (this.toolboxWorkspaces[categoryName]) {
- return this.toolboxWorkspaces[categoryName];
- } else {
- var categoryWorkspace = new Blockly.Workspace();
- if (categoryName == 'no-category') {
- for (var i = 0; i < categoryNode.length; i++) {
- Blockly.Xml.domToBlock(categoryWorkspace, categoryNode[i]);
- }
- } else {
- Blockly.Xml.domToWorkspace(categoryNode, categoryWorkspace);
- }
- this.toolboxWorkspaces[categoryName] = categoryWorkspace;
- return this.toolboxWorkspaces[categoryName];
- }
+ return this.treeService.getToolboxWorkspace(categoryNode);
}
});
diff --git a/accessible/tree.service.js b/accessible/tree.service.js
index ecf5fd8cc..071bc95ea 100644
--- a/accessible/tree.service.js
+++ b/accessible/tree.service.js
@@ -27,27 +27,65 @@
blocklyApp.TreeService = ng.core
.Class({
constructor: [
- blocklyApp.NotificationsService, function(_notificationsService) {
+ blocklyApp.NotificationsService, blocklyApp.UtilsService,
+ blocklyApp.ClipboardService,
+ function(_notificationsService, _utilsService, _clipboardService) {
// Stores active descendant ids for each tree in the page.
this.activeDescendantIds_ = {};
this.notificationsService = _notificationsService;
+ this.utilsService = _utilsService;
+ this.clipboardService = _clipboardService;
+ this.toolboxWorkspaces = {};
}],
getToolboxTreeNode_: function() {
return document.getElementById('blockly-toolbox-tree');
},
- getWorkspaceToolbarButtonNodes_: function() {
- return Array.from(document.querySelectorAll(
- 'button.blocklyWorkspaceToolbarButton'));
- },
// Returns a list of all top-level workspace tree nodes on the page.
getWorkspaceTreeNodes_: function() {
return Array.from(document.querySelectorAll('ol.blocklyWorkspaceTree'));
},
+ getWorkspaceToolbarButtonNodes_: function() {
+ return Array.from(document.querySelectorAll(
+ 'button.blocklyWorkspaceToolbarButton'));
+ },
+ getToolboxWorkspace: function(categoryNode) {
+ if (categoryNode.attributes && categoryNode.attributes.name) {
+ var categoryName = categoryNode.attributes.name.value;
+ } else {
+ var categoryName = 'no-category';
+ }
+
+ if (this.toolboxWorkspaces.hasOwnProperty(categoryName)) {
+ return this.toolboxWorkspaces[categoryName];
+ } else {
+ var categoryWorkspace = new Blockly.Workspace();
+ if (categoryName == 'no-category') {
+ for (var i = 0; i < categoryNode.length; i++) {
+ Blockly.Xml.domToBlock(categoryWorkspace, categoryNode[i]);
+ }
+ } else {
+ Blockly.Xml.domToWorkspace(categoryNode, categoryWorkspace);
+ }
+
+ this.toolboxWorkspaces[categoryName] = categoryWorkspace;
+ return this.toolboxWorkspaces[categoryName];
+ }
+ },
+ getToolboxBlockById: function(blockId) {
+ for (var categoryName in this.toolboxWorkspaces) {
+ var putativeBlock = this.utilsService.getBlockByIdFromWorkspace(
+ blockId, this.toolboxWorkspaces[categoryName]);
+ if (putativeBlock) {
+ return putativeBlock;
+ }
+ }
+ return null;
+ },
// Returns a list of all top-level tree nodes on the page.
getAllTreeNodes_: function() {
var treeNodes = [this.getToolboxTreeNode_()];
- treeNodes = treeNodes.concat(this.getWorkspaceToolbarButtonNodes_());
treeNodes = treeNodes.concat(this.getWorkspaceTreeNodes_());
+ treeNodes = treeNodes.concat(this.getWorkspaceToolbarButtonNodes_());
return treeNodes;
},
isTopLevelWorkspaceTree: function(treeId) {
@@ -239,6 +277,80 @@ blocklyApp.TreeService = ng.core
}
}
},
+ isIsolatedTopLevelBlock_: function(block) {
+ // Returns whether the given block is at the top level, and has no
+ // siblings.
+ var blockIsAtTopLevel = !block.getParent();
+ var blockHasNoSiblings = (
+ (!block.nextConnection ||
+ !block.nextConnection.targetConnection) &&
+ (!block.previousConnection ||
+ !block.previousConnection.targetConnection));
+ return blockIsAtTopLevel && blockHasNoSiblings;
+ },
+ removeBlockAndSetFocus: function(block, blockRootNode, deleteBlockFunc) {
+ // This method runs the given deletion function and then does one of two
+ // things:
+ // - If the block is an isolated top-level block, it shifts the tree
+ // focus.
+ // - Otherwise, it sets the correct new active desc for the current tree.
+ var treeId = this.getTreeIdForBlock(block.id);
+ if (this.isIsolatedTopLevelBlock_(block)) {
+ var nextNodeToFocusOn = this.getNodeToFocusOnWhenTreeIsDeleted(treeId);
+
+ this.clearActiveDesc(treeId);
+ deleteBlockFunc();
+ // Invoke a digest cycle, so that the DOM settles.
+ setTimeout(function() {
+ nextNodeToFocusOn.focus();
+ });
+ } else {
+ var nextActiveDesc = this.getNextActiveDescWhenBlockIsDeleted(
+ blockRootNode);
+ this.runWhilePreservingFocus(
+ deleteBlockFunc, treeId, nextActiveDesc.id);
+ }
+ },
+ cutBlock_: function(block, blockRootNode) {
+ var blockDescription = this.utilsService.getBlockDescription(block);
+
+ var that = this;
+ this.removeBlockAndSetFocus(block, blockRootNode, function() {
+ that.clipboardService.cut(block);
+ });
+
+ setTimeout(function() {
+ if (that.utilsService.isWorkspaceEmpty()) {
+ that.notificationsService.setStatusMessage(
+ blockDescription + ' cut. Workspace is empty.');
+ } else {
+ that.notificationsService.setStatusMessage(
+ blockDescription + ' cut. Now on workspace.');
+ }
+ });
+ },
+ copyBlock_: function(block) {
+ var blockDescription = this.utilsService.getBlockDescription(block);
+ this.clipboardService.copy(block);
+ this.notificationsService.setStatusMessage(
+ blockDescription + ' ' + Blockly.Msg.COPIED_BLOCK_MSG);
+ },
+ pasteToConnection: function(block, connection) {
+ if (this.clipboardService.isClipboardEmpty()) {
+ return;
+ }
+
+ var destinationTreeId = this.getTreeIdForBlock(
+ connection.getSourceBlock().id);
+ this.clearActiveDesc(destinationTreeId);
+
+ var newBlockId = this.clipboardService.pasteFromClipboard(connection);
+ // Invoke a digest cycle, so that the DOM settles.
+ var that = this;
+ setTimeout(function() {
+ that.focusOnBlock(newBlockId);
+ });
+ },
onKeypress: function(e, tree) {
var treeId = tree.id;
var activeDesc = document.getElementById(this.getActiveDescId(treeId));
@@ -248,9 +360,61 @@ blocklyApp.TreeService = ng.core
return;
}
- if (e.altKey || e.ctrlKey) {
+ if (e.altKey) {
// Do not intercept combinations such as Alt+Home.
return;
+ }
+
+ if (e.ctrlKey) {
+ var activeDesc = document.getElementById(this.getActiveDescId(treeId));
+
+ // Scout up the tree to see whether we're in the toolbox or workspace.
+ var scoutNode = activeDesc;
+ var TARGET_TAG_NAMES = ['BLOCKLY-TOOLBOX', 'BLOCKLY-WORKSPACE'];
+ while (TARGET_TAG_NAMES.indexOf(scoutNode.tagName) === -1) {
+ scoutNode = scoutNode.parentNode;
+ }
+ var inToolbox = (scoutNode.tagName == 'BLOCKLY-TOOLBOX');
+
+ // Disallow cutting and pasting in the toolbox.
+ if (inToolbox && e.keyCode != 67) {
+ if (e.keyCode == 86) {
+ this.notificationsService.setStatusMessage(
+ 'Cannot paste block in toolbox.');
+ } else if (e.keyCode == 88) {
+ this.notificationsService.setStatusMessage(
+ 'Cannot cut block in toolbox. Try copying instead.');
+ }
+ }
+
+ // Starting from the activeDesc, walk up the tree until we find the
+ // root of the current block.
+ var blockRootSuffix = inToolbox ? 'toolboxBlockRoot' : 'blockRoot';
+ var putativeBlockRootNode = activeDesc;
+ while (putativeBlockRootNode.id.indexOf(blockRootSuffix) === -1) {
+ putativeBlockRootNode = putativeBlockRootNode.parentNode;
+ }
+ var blockRootNode = putativeBlockRootNode;
+
+ var blockId = blockRootNode.id.substring(
+ 0, blockRootNode.id.length - blockRootSuffix.length);
+ var block = inToolbox ?
+ this.getToolboxBlockById(blockId) :
+ this.utilsService.getBlockById(blockId);
+
+ if (e.keyCode == 88) {
+ // Cut block.
+ this.cutBlock_(block, blockRootNode);
+ } else if (e.keyCode == 67) {
+ // Copy block. Note that, in this case, we might be in the workspace
+ // or toolbox.
+ this.copyBlock_(block);
+ } else if (e.keyCode == 86) {
+ // Paste block, if possible.
+ var targetConnection =
+ e.shiftKey ? block.previousConnection : block.nextConnection;
+ this.pasteToConnection(block, targetConnection);
+ }
} else if (document.activeElement.tagName == 'INPUT') {
// For input fields, only Esc and Tab keystrokes are handled specially.
if (e.keyCode == 27 || e.keyCode == 9) {
@@ -290,6 +454,7 @@ blocklyApp.TreeService = ng.core
break;
} else if (currentNode.tagName == 'INPUT') {
currentNode.focus();
+ currentNode.select();
this.notificationsService.setStatusMessage(
'Type a value, then press Escape to exit');
break;
diff --git a/accessible/utils.service.js b/accessible/utils.service.js
index 3a7eef797..160f90ad6 100644
--- a/accessible/utils.service.js
+++ b/accessible/utils.service.js
@@ -70,5 +70,13 @@ blocklyApp.UtilsService = ng.core
},
isWorkspaceEmpty: function() {
return !blocklyApp.workspace.topBlocks_.length;
+ },
+ getBlockById: function(blockId) {
+ return this.getBlockByIdFromWorkspace(blockId, blocklyApp.workspace);
+ },
+ getBlockByIdFromWorkspace: function(blockId, workspace) {
+ // This is used for non-default workspaces, such as those comprising the
+ // toolbox.
+ return workspace.getBlockById(blockId);
}
});
diff --git a/accessible/workspace-tree.component.js b/accessible/workspace-tree.component.js
index 04ec09b12..33e940e04 100644
--- a/accessible/workspace-tree.component.js
+++ b/accessible/workspace-tree.component.js
@@ -37,7 +37,8 @@ blocklyApp.WorkspaceTreeComponent = ng.core
-
+
@@ -48,8 +49,7 @@ blocklyApp.WorkspaceTreeComponent = ng.core
+ [attr.aria-level]="level + 1">
{{utilsService.getInputTypeLabel(inputBlock.connection)}} {{utilsService.getBlockTypeLabel(inputBlock)}} needed:
@@ -71,7 +71,7 @@ blocklyApp.WorkspaceTreeComponent = ng.core
- {{'MORE_OPTIONS'|translate}}
+ {{'BLOCK_OPTIONS'|translate}}
+
{{'WORKSPACE'|translate}}
-
-
-
-
-
-
-
+
`,
directives: [blocklyApp.WorkspaceTreeComponent],
diff --git a/blockly_compressed.js b/blockly_compressed.js
index ed0c2fac5..1c3599f9a 100644
--- a/blockly_compressed.js
+++ b/blockly_compressed.js
@@ -1341,9 +1341,10 @@ d.setAttribute("gap",16);c.push(d)}Blockly.Blocks.procedures_defreturn&&(d=goog.
Blockly.Procedures.getCallers=function(a,b){for(var c=[],d=b.getAllBlocks(),e=0;e
.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyText {",
-"cursor: default;","fill: #fff;","font-family: sans-serif;","font-size: 11pt;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {","fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyoutButton {","fill: #888;","cursor: default","}",
-".blocklyFlyoutButton:hover {","fill: #ccc;","}",".blocklySvg text {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {",
-"fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyCommentTextarea {","background-color: #ffc;","border: 0;","margin: 0;","padding: 2px;","resize: none;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;","padding: 0 1px;","width: 100%","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;",
-"}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyZoom>image {","opacity: .4;","}",".blocklyZoom>image:hover {","opacity: .6;","}",".blocklyZoom>image:active {","opacity: .8;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",
-".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyAngleCircle {","stroke: #444;","stroke-width: 1;","fill: #ddd;","fill-opacity: .8;","}",".blocklyAngleMarks {","stroke: #444;","stroke-width: 1;","}",".blocklyAngleGauge {","fill: #f88;","fill-opacity: .8;","}",".blocklyAngleLine {","stroke: #f00;","stroke-width: 2;","stroke-linecap: round;","}",".blocklyContextMenu {","border-radius: 4px;","}",".blocklyDropdownMenu {","padding: 0 !important;",
-"}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px !important;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {","height: 22px;","line-height: 22px;","margin-bottom: 3px;",
-"padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;","}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;",
-"width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0px -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {","background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {",
-"background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}",".blocklyWidgetDiv .goog-palette {","outline: none;","cursor: default;",
-"}",".blocklyWidgetDiv .goog-palette-table {","border: 1px solid #666;","border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {","height: 13px;","width: 15px;","margin: 0;","border: 0;","text-align: center;","vertical-align: middle;","border-right: 1px solid #666;","font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {","position: relative;","height: 13px;","width: 15px;","border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {",
-"border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {","border: 1px solid #000;","color: #fff;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;","border-color: #ccc #666 #666 #ccc;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {",
-"color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","padding: 4px 7em 4px 28px;","white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {","padding-left: 7em;","padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {","padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {","padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {",
-"color: #000;","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {","color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: 0.3;","-moz-opacity: 0.3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {","background-color: #d6e9f8;","border-color: #d6e9f8;",
-"border-style: dotted;","border-width: 1px 0;","padding-bottom: 3px;","padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {","background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",
-".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {","color: #999;","direction: ltr;","left: auto;","padding: 0 6px;","position: absolute;","right: 0;","text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {","left: 0;","right: auto;","text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {","text-decoration: underline;",
-"}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {","color: #999;","font-size: 12px;","padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {","border-top: 1px solid #ccc;","margin: 4px 0;","padding: 0;","}",""];Blockly.WidgetDiv={};Blockly.WidgetDiv.DIV=null;Blockly.WidgetDiv.owner_=null;Blockly.WidgetDiv.dispose_=null;Blockly.WidgetDiv.createDom=function(){Blockly.WidgetDiv.DIV||(Blockly.WidgetDiv.DIV=goog.dom.createDom("DIV","blocklyWidgetDiv"),document.body.appendChild(Blockly.WidgetDiv.DIV))};
+"cursor: default;","fill: #fff;","font-family: sans-serif;","font-size: 11pt;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {","fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyoutButton {","fill: #888;","cursor: default;","}",
+".blocklyFlyoutButtonShadow {","fill: #666;","}",".blocklyFlyoutButton:hover {","fill: #aaa;","}",".blocklySvg text {","user-select: none;","-moz-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;",
+"stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyCommentTextarea {","background-color: #ffc;","border: 0;","margin: 0;","padding: 2px;","resize: none;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;","padding: 0 1px;","width: 100%","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {",
+"fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyZoom>image {","opacity: .4;","}",".blocklyZoom>image:hover {","opacity: .6;","}",".blocklyZoom>image:active {","opacity: .8;","}",".blocklyFlyout .blocklyScrollbarHandle {",
+"fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyAngleCircle {","stroke: #444;","stroke-width: 1;","fill: #ddd;","fill-opacity: .8;","}",".blocklyAngleMarks {","stroke: #444;","stroke-width: 1;","}",".blocklyAngleGauge {","fill: #f88;","fill-opacity: .8;","}",".blocklyAngleLine {","stroke: #f00;","stroke-width: 2;","stroke-linecap: round;",
+"}",".blocklyContextMenu {","border-radius: 4px;","}",".blocklyDropdownMenu {","padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<>>/sprites.png) no-repeat -48px -16px !important;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {",
+"outline: none;","}",".blocklyTreeRow {","height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;",
+"height: 0;","margin: 5px 0;","}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0px -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {",
+"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyTreeSelected .blocklyTreeLabel {",
+"color: #fff;","}",".blocklyWidgetDiv .goog-palette {","outline: none;","cursor: default;","}",".blocklyWidgetDiv .goog-palette-table {","border: 1px solid #666;","border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {","height: 13px;","width: 15px;","margin: 0;","border: 0;","text-align: center;","vertical-align: middle;","border-right: 1px solid #666;","font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {","position: relative;","height: 13px;","width: 15px;","border: 1px solid #666;",
+"}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {","border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {","border: 1px solid #000;","color: #fff;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;","border-color: #ccc #666 #666 #ccc;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;",
+"overflow-x: hidden;","max-height: 100%;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","padding: 4px 7em 4px 28px;","white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {","padding-left: 7em;","padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {","padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {",
+"padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {","color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: 0.3;","-moz-opacity: 0.3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {",
+"background-color: #d6e9f8;","border-color: #d6e9f8;","border-style: dotted;","border-width: 1px 0;","padding-bottom: 3px;","padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {","background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {",
+"left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {","background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {","color: #999;","direction: ltr;","left: auto;","padding: 0 6px;","position: absolute;","right: 0;","text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {","left: 0;","right: auto;",
+"text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {","text-decoration: underline;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {","color: #999;","font-size: 12px;","padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {","border-top: 1px solid #ccc;","margin: 4px 0;","padding: 0;","}",""];Blockly.WidgetDiv={};Blockly.WidgetDiv.DIV=null;Blockly.WidgetDiv.owner_=null;Blockly.WidgetDiv.dispose_=null;Blockly.WidgetDiv.createDom=function(){Blockly.WidgetDiv.DIV||(Blockly.WidgetDiv.DIV=goog.dom.createDom("DIV","blocklyWidgetDiv"),document.body.appendChild(Blockly.WidgetDiv.DIV))};
Blockly.WidgetDiv.show=function(a,b,c){Blockly.WidgetDiv.hide();Blockly.WidgetDiv.owner_=a;Blockly.WidgetDiv.dispose_=c;a=goog.style.getViewportPageOffset(document);Blockly.WidgetDiv.DIV.style.top=a.y+"px";Blockly.WidgetDiv.DIV.style.direction=b?"rtl":"ltr";Blockly.WidgetDiv.DIV.style.display="block"};
Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.DIV.style.display="none",Blockly.WidgetDiv.DIV.style.left="",Blockly.WidgetDiv.DIV.style.top="",Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_(),Blockly.WidgetDiv.dispose_=null,goog.dom.removeChildren(Blockly.WidgetDiv.DIV))};Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_};Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()};
Blockly.WidgetDiv.position=function(a,b,c,d,e){bc.width+d.x&&(a=c.width+d.x):a
var ACCESSIBLE_GLOBALS = {
+ // Prefix of path to sound files.
+ mediaPathPrefix: '../../accessible/media/',
// Additional buttons for the workspace toolbar that
// go before the "Clear Workspace" button.
- toolbarButtonConfig: [],
- // Prefix of path to sound files.
- mediaPathPrefix: '../../accessible/media/'
+ toolbarButtonConfig: []
};
document.addEventListener('DOMContentLoaded', function() {
ng.platform.browser.bootstrap(blocklyApp.AppView);
diff --git a/demos/interpreter/acorn_interpreter.js b/demos/interpreter/acorn_interpreter.js
index 698f14cc3..b67b99b67 100644
--- a/demos/interpreter/acorn_interpreter.js
+++ b/demos/interpreter/acorn_interpreter.js
@@ -1,153 +1,168 @@
-var mod$$inline_58=function(a){function b(a){n=a||{};for(var b in Ua)Object.prototype.hasOwnProperty.call(n,b)||(n[b]=Ua[b]);wa=n.sourceFile||null}function c(a,b){var c=Ab(k,a);b+=" ("+c.line+":"+c.column+")";var f=new SyntaxError(b);f.pos=a;f.loc=c;f.raisedAt=g;throw f;}function d(a){function b(a){if(1==a.length)return c+="return str === "+JSON.stringify(a[0])+";";c+="switch(str){";for(var va=0;vaa)++g;else if(47===a)if(a=k.charCodeAt(g+1),42===a){var a=n.onComment&&n.locations&&new f,b=g,e=k.indexOf("*/",g+=2);-1===e&&c(g-2,"Unterminated comment");
-g=e+2;if(n.locations){Y.lastIndex=b;for(var d=void 0;(d=Y.exec(k))&&d.index=a?a=P(!0):(++g,a=e(xa)),a;case 40:return++g,e(J);case 41:return++g,e(F);case 59:return++g,e(K);case 44:return++g,e(L);case 91:return++g,e(ja);
-case 93:return++g,e(ka);case 123:return++g,e(Z);case 125:return++g,e(T);case 58:return++g,e(aa);case 63:return++g,e(ya);case 48:if(a=k.charCodeAt(g+1),120===a||88===a)return g+=2,a=x(16),null==a&&c(y+2,"Expected hexadecimal number"),la(k.charCodeAt(g))&&c(g,"Identifier directly after number"),a=e(ba,a);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return P(!1);case 34:case 39:a:{g++;for(var b="";;){g>=S&&c(y,"Unterminated string constant");var f=k.charCodeAt(g);if(f===a){++g;
-a=e(da,b);break a}if(92===f){var f=k.charCodeAt(++g),d=/^[0-7]+/.exec(k.slice(g,g+3));for(d&&(d=d[0]);d&&255=S)return e(pa);var b=k.charCodeAt(g);if(la(b)||92===b)return Ya();a=m(b);if(!1===a){b=String.fromCharCode(b);if("\\"===b||Za.test(b))return Ya();c(g,"Unexpected character '"+b+"'")}return a}function t(a,b){var c=k.slice(g,g+b);g+=b;e(a,c)}function D(){for(var a="",b,f,d=g;;){g>=
-S&&c(d,"Unterminated regular expression");a=k.charAt(g);na.test(a)&&c(d,"Unterminated regular expression");if(b)b=!1;else{if("["===a)f=!0;else if("]"===a&&f)f=!1;else if("/"===a&&!f)break;b="\\"===a}++g}a=k.slice(d,g);++g;(b=$a())&&!/^[gmsiy]*$/.test(b)&&c(d,"Invalid regexp flag");return e(Ba,new RegExp(a,b))}function x(a,b){for(var c=g,f=0,e=0,d=null==b?Infinity:b;e=h?h-48:Infinity;if(h>=a)break;++g;f=f*a+h}return g===c||null!=
-b&&g-c!==b?null:f}function P(a){var b=g,f=!1,d=48===k.charCodeAt(g);a||null!==x(10)||c(b,"Invalid number");46===k.charCodeAt(g)&&(++g,x(10),f=!0);a=k.charCodeAt(g);if(69===a||101===a)a=k.charCodeAt(++g),43!==a&&45!==a||++g,null===x(10)&&c(b,"Invalid number"),f=!0;la(k.charCodeAt(g))&&c(g,"Identifier directly after number");a=k.slice(b,g);var h;f?h=parseFloat(a):d&&1!==a.length?/[89]/.test(a)||C?c(b,"Invalid number"):h=parseInt(a,8):h=parseInt(a,10);return e(ba,h)}function ma(a){a=x(16,a);null===a&&
-c(y,"Bad character escape sequence");return a}function $a(){ca=!1;for(var a,b=!0,f=g;;){var e=k.charCodeAt(g);if(ab(e))ca&&(a+=k.charAt(g)),++g;else if(92===e){ca||(a=k.slice(f,g));ca=!0;117!=k.charCodeAt(++g)&&c(g,"Expecting Unicode escape sequence \\uXXXX");++g;var e=ma(4),d=String.fromCharCode(e);d||c(g-1,"Invalid Unicode escape");(b?la(e):ab(e))||c(g-4,"Invalid Unicode escape");a+=d}else break;b=!1}return ca?a:k.slice(f,g)}function Ya(){var a=$a(),b=V;ca||(Lb(a)?b=Ca[a]:(n.forbidReserved&&(3===
-n.ecmaVersion?Mb:Nb)(a)||C&&bb(a))&&c(y,"The keyword '"+a+"' is reserved"));return e(b,a)}function r(){Da=y;M=X;Ea=ia;A()}function Fa(a){C=a;g=M;if(n.locations)for(;gb){var e=Q(a);e.left=a;e.operator=I;a=p;r();e.right=Ra(Sa(),f,c);f=q(e,a===Va||a===Wa?"LogicalExpression":"BinaryExpression");return Ra(f,b,c)}return a}function Sa(){if(p.prefix){var a=z(),b=p.isUpdate;a.operator=I;R=a.prefix=!0;r();a.argument=
-Sa();b?ra(a.argument):C&&"delete"===a.operator&&"Identifier"===a.argument.type&&c(a.start,"Deleting local variable in strict mode");return q(a,b?"UpdateExpression":"UnaryExpression")}for(b=ha(ua());p.postfix&&!qa();)a=Q(b),a.operator=I,a.prefix=!1,a.argument=b,ra(b),r(),b=q(a,"UpdateExpression");return b}function ha(a,b){if(u(xa)){var c=Q(a);c.object=a;c.property=O(!0);c.computed=!1;return ha(q(c,"MemberExpression"),b)}return u(ja)?(c=Q(a),c.object=a,c.property=B(),c.computed=!0,v(ka),ha(q(c,"MemberExpression"),
-b)):!b&&u(J)?(c=Q(a),c.callee=a,c.arguments=Ta(F,!1),ha(q(c,"CallExpression"),b)):a}function ua(){switch(p){case ub:var a=z();r();return q(a,"ThisExpression");case V:return O();case ba:case da:case Ba:return a=z(),a.value=I,a.raw=k.slice(y,X),r(),q(a,"Literal");case vb:case wb:case xb:return a=z(),a.value=p.atomValue,a.raw=p.keyword,r(),q(a,"Literal");case J:var a=oa,b=y;r();var f=B();f.start=b;f.end=X;n.locations&&(f.loc.start=a,f.loc.end=ia);n.ranges&&(f.range=[b,X]);v(F);return f;case ja:return a=
-z(),r(),a.elements=Ta(ka,!0,!0),q(a,"ArrayExpression");case Z:a=z();b=!0;f=!1;a.properties=[];for(r();!u(T);){if(b)b=!1;else if(v(L),n.allowTrailingCommas&&u(T))break;var e={key:p===ba||p===da?ua():O(!0)},d=!1,h;u(aa)?(e.value=B(!0),h=e.kind="init"):5<=n.ecmaVersion&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)?(d=f=!0,h=e.kind=e.key.name,e.key=p===ba||p===da?ua():O(!0),p!==J&&N(),e.value=Na(z(),!1)):N();if("Identifier"===e.key.type&&(C||f))for(var g=0;gf?a.id:a.params[f],(bb(e.name)||sa(e.name))&&c(e.start,"Defining '"+e.name+"' in strict mode"),0<=f)for(var d=0;da)++f;else if(47===a)if(a=k.charCodeAt(f+1),42===a){var a=n.onComment&&n.locations&&new e,b=f,d=k.indexOf("*/",f+=2);-1===d&&c(f-2,"Unterminated comment");
+f=d+2;if(n.locations){Y.lastIndex=b;for(var g=void 0;(g=Y.exec(k))&&g.index=a?a=P(!0):(++f,a=g(xa)),a;case 40:return++f,g(I);case 41:return++f,g(E);case 59:return++f,g(J);case 44:return++f,g(L);case 91:return++f,g(ja);
+case 93:return++f,g(ka);case 123:return++f,g(Z);case 125:return++f,g(T);case 58:return++f,g(aa);case 63:return++f,g(ya);case 48:if(a=k.charCodeAt(f+1),120===a||88===a)return f+=2,a=B(16),null==a&&c(x+2,"Expected hexadecimal number"),la(k.charCodeAt(f))&&c(f,"Identifier directly after number"),a=g(ba,a);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return P(!1);case 34:case 39:a:{f++;for(var b="";;){f>=S&&c(x,"Unterminated string constant");var d=k.charCodeAt(f);if(d===a){++f;
+a=g(da,b);break a}if(92===d){var d=k.charCodeAt(++f),e=/^[0-7]+/.exec(k.slice(f,f+3));for(e&&(e=e[0]);e&&255=S)return g(pa);var b=k.charCodeAt(f);if(la(b)||92===b)return Ya();a=m(b);if(!1===a){b=String.fromCharCode(b);if("\\"===b||Za.test(b))return Ya();c(f,"Unexpected character '"+b+"'")}return a}function t(a,b){var c=k.slice(f,f+b);f+=b;g(a,c)}function K(){for(var a,b,d=f;;){f>=S&&c(d,
+"Unterminated regular expression");var e=k.charAt(f);na.test(e)&&c(d,"Unterminated regular expression");if(a)a=!1;else{if("["===e)b=!0;else if("]"===e&&b)b=!1;else if("/"===e&&!b)break;a="\\"===e}++f}a=k.slice(d,f);++f;(b=$a())&&!/^[gmsiy]*$/.test(b)&&c(d,"Invalid regexp flag");return g(Ba,new RegExp(a,b))}function B(a,b){for(var c=f,d=0,e=0,g=null==b?Infinity:b;e=h?h-48:Infinity;if(h>=a)break;++f;d=d*a+h}return f===c||null!=b&&
+f-c!==b?null:d}function P(a){var b=f,d=!1,e=48===k.charCodeAt(f);a||null!==B(10)||c(b,"Invalid number");46===k.charCodeAt(f)&&(++f,B(10),d=!0);a=k.charCodeAt(f);if(69===a||101===a)a=k.charCodeAt(++f),43!==a&&45!==a||++f,null===B(10)&&c(b,"Invalid number"),d=!0;la(k.charCodeAt(f))&&c(f,"Identifier directly after number");a=k.slice(b,f);var h;d?h=parseFloat(a):e&&1!==a.length?/[89]/.test(a)||C?c(b,"Invalid number"):h=parseInt(a,8):h=parseInt(a,10);return g(ba,h)}function ma(a){a=B(16,a);null===a&&c(x,
+"Bad character escape sequence");return a}function $a(){ca=!1;for(var a,b=!0,d=f;;){var e=k.charCodeAt(f);if(ab(e))ca&&(a+=k.charAt(f)),++f;else if(92===e){ca||(a=k.slice(d,f));ca=!0;117!=k.charCodeAt(++f)&&c(f,"Expecting Unicode escape sequence \\uXXXX");++f;var e=ma(4),g=String.fromCharCode(e);g||c(f-1,"Invalid Unicode escape");(b?la(e):ab(e))||c(f-4,"Invalid Unicode escape");a+=g}else break;b=!1}return ca?a:k.slice(d,f)}function Ya(){var a=$a(),b=V;ca||(Lb(a)?b=Ca[a]:(n.forbidReserved&&(3===n.ecmaVersion?
+Mb:Nb)(a)||C&&bb(a))&&c(x,"The keyword '"+a+"' is reserved"));return g(b,a)}function r(){Da=x;M=X;Ea=ia;z()}function Fa(a){C=a;f=M;if(n.locations)for(;fb){var e=Q(a);e.left=a;e.operator=H;a=p;r();e.right=Ra(Sa(),d,c);d=q(e,a===Va||a===Wa?"LogicalExpression":"BinaryExpression");return Ra(d,b,c)}return a}function Sa(){if(p.prefix){var a=y(),b=p.isUpdate;a.operator=H;R=a.prefix=!0;r();a.argument=
+Sa();b?ra(a.argument):C&&"delete"===a.operator&&"Identifier"===a.argument.type&&c(a.start,"Deleting local variable in strict mode");return q(a,b?"UpdateExpression":"UnaryExpression")}for(b=ha(ua());p.postfix&&!qa();)a=Q(b),a.operator=H,a.prefix=!1,a.argument=b,ra(b),r(),b=q(a,"UpdateExpression");return b}function ha(a,b){if(u(xa)){var c=Q(a);c.object=a;c.property=O(!0);c.computed=!1;return ha(q(c,"MemberExpression"),b)}return u(ja)?(c=Q(a),c.object=a,c.property=A(),c.computed=!0,v(ka),ha(q(c,"MemberExpression"),
+b)):!b&&u(I)?(c=Q(a),c.callee=a,c.arguments=Ta(E,!1),ha(q(c,"CallExpression"),b)):a}function ua(){switch(p){case ub:var a=y();r();return q(a,"ThisExpression");case V:return O();case ba:case da:case Ba:return a=y(),a.value=H,a.raw=k.slice(x,X),r(),q(a,"Literal");case vb:case wb:case xb:return a=y(),a.value=p.atomValue,a.raw=p.keyword,r(),q(a,"Literal");case I:var a=oa,b=x;r();var d=A();d.start=b;d.end=X;n.locations&&(d.loc.start=a,d.loc.end=ia);n.ranges&&(d.range=[b,X]);v(E);return d;case ja:return a=
+y(),r(),a.elements=Ta(ka,!0,!0),q(a,"ArrayExpression");case Z:a=y();b=!0;d=!1;a.properties=[];for(r();!u(T);){if(b)b=!1;else if(v(L),n.allowTrailingCommas&&u(T))break;var e={key:p===ba||p===da?ua():O(!0)},g=!1,h;u(aa)?(e.value=A(!0),h=e.kind="init"):5<=n.ecmaVersion&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)?(g=d=!0,h=e.kind=e.key.name,e.key=p===ba||p===da?ua():O(!0),p!==I&&N(),e.value=Na(y(),!1)):N();if("Identifier"===e.key.type&&(C||d))for(var f=0;fd?a.id:a.params[d],(bb(e.name)||sa(e.name))&&c(e.start,"Defining '"+e.name+"' in strict mode"),0<=d)for(var g=0;ga?36===a:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Za.test(String.fromCharCode(a))},ab=a.isIdentifierChar=function(a){return 48>a?36===a:58>a?!0:65>a?!1:91>a?!0:97>a?95===a:123>a?!0:170<=a&&Pb.test(String.fromCharCode(a))},ca,Ia={kind:"loop"},Ob={kind:"switch"}};
-"object"==typeof exports&&"object"==typeof module?mod$$inline_58(exports):"function"==typeof define&&define.amd?define(["exports"],mod$$inline_58):mod$$inline_58(this.acorn||(this.acorn={}));/*
-
- JavaScript Interpreter
-
- Copyright 2013 Google Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-var Interpreter=function(a,b){this.ast=acorn.parse(a);this.initFunc_=b;this.paused_=!1;this.UNDEFINED=new Interpreter.Primitive(void 0,this);this.NULL=new Interpreter.Primitive(null,this);this.TRUE=new Interpreter.Primitive(!0,this);this.FALSE=new Interpreter.Primitive(!1,this);this.NUMBER_ZERO=new Interpreter.Primitive(0,this);this.NUMBER_ONE=new Interpreter.Primitive(1,this);this.STRING_EMPTY=new Interpreter.Primitive("",this);var c=this.createScope(this.ast,null);this.TRUE.parent=this.BOOLEAN;
-this.FALSE.parent=this.BOOLEAN;this.NUMBER_ZERO.parent=this.NUMBER;this.NUMBER_ONE.parent=this.NUMBER;this.STRING_EMPTY.parent=this.STRING;this.stateStack=[{node:this.ast,scope:c,thisExpression:c,done:!1}]};
-Interpreter.prototype.appendCode=function(a){var b=this.stateStack[this.stateStack.length-1];if(!b||"Program"!=b.node.type)throw"Expecting original AST to start with a Program node.";a=acorn.parse(a);if(!a||"Program"!=a.type)throw"Expecting new AST to start with a Program node.";for(var c=0,d;d=a.body[c];c++)b.node.body.push(d);b.done=!1};
-Interpreter.prototype.step=function(){var a=this.stateStack[0];if(!a||"Program"==a.node.type&&a.done)return!1;if(this.paused_)return!0;this["step"+a.node.type]();return!0};Interpreter.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_};
-Interpreter.prototype.initGlobalScope=function(a){this.setProperty(a,"Infinity",this.createPrimitive(Infinity),!0);this.setProperty(a,"NaN",this.createPrimitive(NaN),!0);this.setProperty(a,"undefined",this.UNDEFINED,!0);this.setProperty(a,"window",a,!0);this.setProperty(a,"self",a,!1);this.initFunction(a);this.initObject(a);a.parent=this.OBJECT;this.initArray(a);this.initNumber(a);this.initString(a);this.initBoolean(a);this.initDate(a);this.initMath(a);this.initRegExp(a);this.initJSON(a);var b=this,
-c;c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isNaN(a.toNumber()))};this.setProperty(a,"isNaN",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isFinite(a.toNumber()))};this.setProperty(a,"isFinite",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(parseFloat(a.toNumber()))};this.setProperty(a,"parseFloat",this.createNativeFunction(c));c=function(a,c){a=a||b.UNDEFINED;c=c||b.UNDEFINED;return b.createPrimitive(parseInt(a.toString(),
-c.toNumber()))};this.setProperty(a,"parseInt",this.createNativeFunction(c));c=this.createObject(this.FUNCTION);c.eval=!0;this.setProperty(c,"length",this.NUMBER_ONE,!0);this.setProperty(a,"eval",c);for(var d="escape unescape decodeURI decodeURIComponent encodeURI encodeURIComponent".split(" "),f=0;fa?Math.max(this.length+a,0):Math.min(a,this.length);e=c(e,Infinity);e=Math.min(e,this.length-a);for(var l=b.createObject(b.ARRAY),m=a;m=a;m--)this.properties[m+arguments.length-2]=this.properties[m];this.length+=arguments.length-2;for(m=2;ml&&(l=this.length+l);var l=Math.max(0,Math.min(l,this.length)),m=c(e,this.length);0>m&&(m=this.length+m);for(var m=Math.max(0,Math.min(m,this.length)),A=0;lh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));hh&&(h=this.length+h);for(h=Math.max(0,Math.min(h,this.length));0<=h;h--){var l=b.getProperty(this,h);if(0==b.comp(l,a))return b.createPrimitive(h)}return b.createPrimitive(-1)};
-this.setProperty(this.ARRAY.properties.prototype,"lastIndexOf",this.createNativeFunction(d),!1,!0);d=function(){for(var a=[],c=0;cb?1:0};Interpreter.prototype.arrayIndex=function(a){a=Number(a);return!isFinite(a)||a!=Math.floor(a)||0>a?NaN:a};
-Interpreter.Primitive=function(a,b){var c=typeof a;this.data=a;this.type=c;"number"==c?this.parent=b.NUMBER:"string"==c?this.parent=b.STRING:"boolean"==c&&(this.parent=b.BOOLEAN)};Interpreter.Primitive.prototype.data=void 0;Interpreter.Primitive.prototype.type=void 0;Interpreter.Primitive.prototype.parent=null;Interpreter.Primitive.prototype.isPrimitive=!0;Interpreter.Primitive.prototype.toBoolean=function(){return Boolean(this.data)};Interpreter.Primitive.prototype.toNumber=function(){return Number(this.data)};
-Interpreter.Primitive.prototype.toString=function(){return String(this.data)};Interpreter.Primitive.prototype.valueOf=function(){return this.data};Interpreter.prototype.createPrimitive=function(a){return void 0===a?this.UNDEFINED:null===a?this.NULL:!0===a?this.TRUE:!1===a?this.FALSE:0===a?this.NUMBER_ZERO:1===a?this.NUMBER_ONE:""===a?this.STRING_EMPTY:a instanceof RegExp?this.createRegExp(this.createObject(this.REGEXP),a):new Interpreter.Primitive(a,this)};
-Interpreter.prototype.createObject=function(a){a={isPrimitive:!1,type:"object",parent:a,fixed:Object.create(null),nonenumerable:Object.create(null),properties:Object.create(null),toBoolean:function(){return!0},toNumber:function(){return NaN},toString:function(){return"["+this.type+"]"},valueOf:function(){return this}};this.isa(a,this.FUNCTION)&&(a.type="function",this.setProperty(a,"prototype",this.createObject(this.OBJECT||null)));this.isa(a,this.ARRAY)&&(a.length=0,a.toNumber=function(){return 0},
-a.toString=function(){for(var a=[],c=0;c>="==b.operator)b=f>>e;else if(">>>="==b.operator)b=f>>>e;else if("&="==b.operator)b=f&e;else if("^="==b.operator)b=f^e;else if("|="==b.operator)b=f|e;else throw"Unknown assignment expression: "+b.operator;b=this.createPrimitive(b)}this.setValue(c,b);this.stateStack[0].value=b}else a.doneRight=!0,a.leftSide=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left,components:!0})};
+"object"==typeof exports&&"object"==typeof module?mod$$inline_58(exports):"function"==typeof define&&define.amd?define(["exports"],mod$$inline_58):mod$$inline_58(this.acorn||(this.acorn={}));
+// JS-Interpreter: Copyright 2013 Google Inc, Apache 2.0
+var Interpreter=function(a,b){"string"==typeof a&&(a=acorn.parse(a,Interpreter.PARSE_OPTIONS));this.ast=a;this.initFunc_=b;this.paused_=!1;this.polyfills_=[];this.UNDEFINED=new Interpreter.Primitive(void 0,this);this.NULL=new Interpreter.Primitive(null,this);this.NAN=new Interpreter.Primitive(NaN,this);this.TRUE=new Interpreter.Primitive(!0,this);this.FALSE=new Interpreter.Primitive(!1,this);this.NUMBER_ZERO=new Interpreter.Primitive(0,this);this.NUMBER_ONE=new Interpreter.Primitive(1,this);this.STRING_EMPTY=
+new Interpreter.Primitive("",this);var c=this.createScope(this.ast,null);this.NAN.parent=this.NUMBER;this.TRUE.parent=this.BOOLEAN;this.FALSE.parent=this.BOOLEAN;this.NUMBER_ZERO.parent=this.NUMBER;this.NUMBER_ONE.parent=this.NUMBER;this.STRING_EMPTY.parent=this.STRING;this.ast=acorn.parse(this.polyfills_.join("\n"),Interpreter.PARSE_OPTIONS);this.polyfills_=void 0;this.stripLocations_(this.ast);this.stateStack=[{node:this.ast,scope:c,thisExpression:c,done:!1}];this.run();this.value=this.UNDEFINED;
+this.ast=a;this.stateStack=[{node:this.ast,scope:c,thisExpression:c,done:!1}]};Interpreter.PARSE_OPTIONS={ecmaVersion:5};Interpreter.READONLY_DESCRIPTOR={configurable:!0,enumerable:!0,writable:!1};Interpreter.NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!0};Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!1};
+Interpreter.prototype.appendCode=function(a){var b=this.stateStack[this.stateStack.length-1];if(!b||"Program"!=b.node.type)throw Error("Expecting original AST to start with a Program node.");"string"==typeof a&&(a=acorn.parse(a,Interpreter.PARSE_OPTIONS));if(!a||"Program"!=a.type)throw Error("Expecting new AST to start with a Program node.");this.populateScope_(a,b.scope);for(var c=0,d;d=a.body[c];c++)b.node.body.push(d);b.done=!1};
+Interpreter.prototype.step=function(){var a=this.stateStack[0];if(!a||"Program"==a.node.type&&a.done)return!1;if(this.paused_)return!0;this["step"+a.node.type]();return a.node.end?!0:this.step()};Interpreter.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_};
+Interpreter.prototype.initGlobalScope=function(a){this.setProperty(a,"Infinity",this.createPrimitive(Infinity),Interpreter.READONLY_DESCRIPTOR);this.setProperty(a,"NaN",this.NAN,Interpreter.READONLY_DESCRIPTOR);this.setProperty(a,"undefined",this.UNDEFINED,Interpreter.READONLY_DESCRIPTOR);this.setProperty(a,"window",a,Interpreter.READONLY_DESCRIPTOR);this.setProperty(a,"self",a);this.initFunction(a);this.initObject(a);a.parent=this.OBJECT;this.initArray(a);this.initNumber(a);this.initString(a);this.initBoolean(a);
+this.initDate(a);this.initMath(a);this.initRegExp(a);this.initJSON(a);this.initError(a);var b=this,c;c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isNaN(a.toNumber()))};this.setProperty(a,"isNaN",this.createNativeFunction(c));c=function(a){a=a||b.UNDEFINED;return b.createPrimitive(isFinite(a.toNumber()))};this.setProperty(a,"isFinite",this.createNativeFunction(c));this.setProperty(a,"parseFloat",this.getProperty(this.NUMBER,"parseFloat"));this.setProperty(a,"parseInt",this.getProperty(this.NUMBER,
+"parseInt"));c=this.createObject(this.FUNCTION);c.eval=!0;this.setProperty(c,"length",this.NUMBER_ONE,Interpreter.READONLY_DESCRIPTOR);this.setProperty(a,"eval",c);for(var d=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],g=0;ga?Math.max(this.length+a,0):Math.min(a,this.length);d=c(d,Infinity);d=Math.min(d,this.length-a);for(var g=b.createObject(b.ARRAY),h=a;h=a;h--)this.properties[h+arguments.length-2]=this.properties[h];this.length+=arguments.length-2;for(h=2;hh&&(h=this.length+h);var h=Math.max(0,Math.min(h,this.length)),q=c(d,this.length);0>q&&(q=this.length+q);for(var q=Math.max(0,Math.min(q,this.length)),w=0;hg&&(g=this.length+g);for(g=Math.max(0,g);gg&&(g=this.length+g);for(g=Math.min(g,this.length-1);0<=g;g--){var h=b.getProperty(this,g);if(h.isPrimitive&&a.isPrimitive?h.data===a.data:h===a)return b.createPrimitive(g)}return b.createPrimitive(-1)};this.setNativeFunctionPrototype(this.ARRAY,"lastIndexOf",d);this.polyfills_.push("Object.defineProperty(Array.prototype, 'every', {configurable: true, value:",
+"function(callbackfn, thisArg) {","if (this == null || typeof callbackfn !== 'function') throw new TypeError;","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;","}","});","Object.defineProperty(Array.prototype, 'filter', {configurable: true, value:","function(fun/*, thisArg*/) {","if (this === void 0 || this === null || typeof fun !== 'function') throw new TypeError;",
+"var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {","var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}","});","Object.defineProperty(Array.prototype, 'forEach', {configurable: true, value:","function(callback, thisArg) {","if (this == null || typeof callback !== 'function') throw new TypeError;","var T, k;","var O = Object(this);",
+"var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'map', {configurable: true, value:","function(callback, thisArg) {","if (this == null || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);","k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);",
+"k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce', {configurable: true, value:","function(callback /*, initialValue*/) {","if (this == null || typeof callback !== 'function') throw new TypeError;","var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length == 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw new TypeError('Reduce of empty array with no initial value');","}","value = t[k++];",
+"}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight', {configurable: true, value:","function(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw new TypeError;","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in t)) k--;",
+"if (k < 0) {","throw new TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'some', {configurable: true, value:","function(fun/*, thisArg*/) {","if (this == null || typeof fun !== 'function') throw new TypeError;","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;",
+"for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","Object.defineProperty(Array.prototype, 'sort', {configurable: true, value:","function(opt_comp) {","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp ?opt_comp(this[j], this[j + 1]) > 0 : this[j] > this[j + 1]) {","var swap = this[j];","this[j] = this[j + 1];","this[j + 1] = swap;","changes++;",
+"}","}","if (changes <= 1) break;","}","return this;","}","});","Object.defineProperty(Array.prototype, 'toLocaleString', {configurable: true, value:","function() {","var out = [];","for (var i = 0; i < this.length; i++) {","out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")};
+Interpreter.prototype.initNumber=function(a){var b=this,c;c=function(a){a=a?a.toNumber():0;if(this.parent!=b.NUMBER)return b.createPrimitive(a);this.data=a;return this};this.NUMBER=this.createNativeFunction(c);this.setProperty(a,"Number",this.NUMBER);a=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"];for(c=0;cb?1:0};Interpreter.prototype.arrayIndex=function(a){a=Number(a);return!isFinite(a)||a!=Math.floor(a)||0>a?NaN:a};
+Interpreter.Primitive=function(a,b){var c=typeof a;this.data=a;this.type=c;"number"==c?this.parent=b.NUMBER:"string"==c?this.parent=b.STRING:"boolean"==c&&(this.parent=b.BOOLEAN)};Interpreter.Primitive.prototype.data=void 0;Interpreter.Primitive.prototype.type="undefined";Interpreter.Primitive.prototype.parent=null;Interpreter.Primitive.prototype.isPrimitive=!0;Interpreter.Primitive.prototype.toBoolean=function(){return!!this.data};Interpreter.Primitive.prototype.toNumber=function(){return Number(this.data)};
+Interpreter.Primitive.prototype.toString=function(){return String(this.data)};Interpreter.Primitive.prototype.valueOf=function(){return this.data};Interpreter.prototype.createPrimitive=function(a){return void 0===a?this.UNDEFINED:null===a?this.NULL:!0===a?this.TRUE:!1===a?this.FALSE:0===a?this.NUMBER_ZERO:1===a?this.NUMBER_ONE:""===a?this.STRING_EMPTY:a instanceof RegExp?this.populateRegExp_(this.createObject(this.REGEXP),a):new Interpreter.Primitive(a,this)};
+Interpreter.Object=function(a){this.notConfigurable=Object.create(null);this.notEnumerable=Object.create(null);this.notWritable=Object.create(null);this.getter=Object.create(null);this.setter=Object.create(null);this.properties=Object.create(null);this.parent=a};Interpreter.Object.prototype.type="object";Interpreter.Object.prototype.parent=null;Interpreter.Object.prototype.isPrimitive=!1;Interpreter.Object.prototype.data=void 0;Interpreter.Object.prototype.toBoolean=function(){return!0};
+Interpreter.Object.prototype.toNumber=function(){return Number(void 0===this.data?this.toString():this.data)};Interpreter.Object.prototype.toString=function(){return void 0===this.data?"["+this.type+"]":String(this.data)};Interpreter.Object.prototype.valueOf=function(){return void 0===this.data?this:this.data};
+Interpreter.prototype.createObject=function(a){a=new Interpreter.Object(a);this.isa(a,this.FUNCTION)&&(a.type="function",this.setProperty(a,"prototype",this.createObject(this.OBJECT||null)));this.isa(a,this.ARRAY)&&(a.length=0,a.toString=function(){for(var a=[],c=0;c>="==b.operator)b=d>>g;else if(">>>="==b.operator)b=d>>>g;else if("&="==b.operator)b=d&g;else if("^="==b.operator)b=d^g;else if("|="==b.operator)b=d|g;else throw SyntaxError("Unknown assignment expression: "+b.operator);b=this.createPrimitive(b)}(c=this.setValue(a.leftSide,b))?(a.doneSetter_=b,this.stateStack.unshift({node:{type:"CallExpression"},doneCallee_:!0,funcThis_:a.leftSide[0],func_:c,doneArgs_:!0,arguments:[b]})):
+(this.stateStack.shift(),this.stateStack[0].value=b)}else{a.leftSide||(a.leftSide=a.value);a.doneGetter_&&(a.leftValue=a.value);if(!a.doneGetter_&&"="!=b.operator&&(a.leftValue=this.getValue(a.leftSide),a.leftValue.isGetter)){a.leftValue.isGetter=!1;a.doneGetter_=!0;this.stateStack.unshift({node:{type:"CallExpression"},doneCallee_:!0,funcThis_:a.leftSide[0],func_:a.leftValue,doneArgs_:!0,arguments:[]});return}a.doneRight=!0;this.stateStack.unshift({node:b.right})}else a.doneLeft=!0,this.stateStack.unshift({node:b.left,
+components:!0})};
Interpreter.prototype.stepBinaryExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneLeft)if(a.doneRight){this.stateStack.shift();var c=a.leftValue,a=a.value,d=this.comp(c,a);if("=="==b.operator||"!="==b.operator)c=c.isPrimitive&&a.isPrimitive?c.data==a.data:0===d,"!="==b.operator&&(c=!c);else if("==="==b.operator||"!=="==b.operator)c=c.isPrimitive&&a.isPrimitive?c.data===a.data:c===a,"!=="==b.operator&&(c=!c);else if(">"==b.operator)c=1==d;else if(">="==b.operator)c=1==d||0===d;else if("<"==
-b.operator)c=-1==d;else if("<="==b.operator)c=-1==d||0===d;else if("+"==b.operator)"string"==c.type||"string"==a.type?(c=c.toString(),a=a.toString()):(c=c.toNumber(),a=a.toNumber()),c+=a;else if("in"==b.operator)c=this.hasProperty(a,c);else if(c=c.toNumber(),a=a.toNumber(),"-"==b.operator)c-=a;else if("*"==b.operator)c*=a;else if("/"==b.operator)c/=a;else if("%"==b.operator)c%=a;else if("&"==b.operator)c&=a;else if("|"==b.operator)c|=a;else if("^"==b.operator)c^=a;else if("<<"==b.operator)c<<=a;else if(">>"==
-b.operator)c>>=a;else if(">>>"==b.operator)c>>>=a;else throw"Unknown binary operator: "+b.operator;this.stateStack[0].value=this.createPrimitive(c)}else a.doneRight=!0,a.leftValue=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left})};Interpreter.prototype.stepBlockStatement=function(){var a=this.stateStack[0],b=a.node,c=a.n_||0;b.body[c]?(a.done=!1,a.n_=c+1,this.stateStack.unshift({node:b.body[c]})):(a.done=!0,"Program"!=a.node.type&&this.stateStack.shift())};
-Interpreter.prototype.stepBreakStatement=function(){var a=this.stateStack.shift(),a=a.node,b=null;a.label&&(b=a.label.name);for(a=this.stateStack.shift();a&&"CallExpression"!=a.node.type&&"NewExpression"!=a.node.type;){if(b?b==a.label:a.isLoop||a.isSwitch)return;a=this.stateStack.shift()}throw new SyntaxError("Illegal break statement");};
-Interpreter.prototype.stepCallExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneCallee_){if(a.func_)c=a.n_,a.arguments.length!=b.arguments.length&&(a.arguments[c-1]=a.value);else{if("function"==a.value.type)a.func_=a.value;else if(a.member_=a.value[0],a.func_=this.getValue(a.value),!a.func_||"function"!=a.func_.type){this.throwException((a.func_&&a.func_.type)+" is not a function");return}"NewExpression"==a.node.type?(a.funcThis_=this.createObject(a.func_),a.isConstructor_=!0):a.funcThis_=
-a.value.length?a.value[0]:this.stateStack[this.stateStack.length-1].thisExpression;a.arguments=[];var c=0}if(b.arguments[c])a.n_=c+1,this.stateStack.unshift({node:b.arguments[c]});else if(a.doneExec)this.stateStack.shift(),this.stateStack[0].value=a.isConstructor_&&"object"!==a.value.type?a.funcThis_:a.value;else{a.doneExec=!0;if(a.func_.node&&("FunctionApply_"==a.func_.node.type||"FunctionCall_"==a.func_.node.type)){a.funcThis_=a.arguments.shift();if("FunctionApply_"==a.func_.node.type){var d=a.arguments.shift();
-if(d&&this.isa(d,this.ARRAY))for(a.arguments=[],b=0;bb?a.arguments[b]:this.UNDEFINED;this.setProperty(c,d,f)}d=this.createObject(this.ARRAY);for(b=0;b>"==b.operator)c>>=a;else if(">>>"==b.operator)c>>>=a;else throw SyntaxError("Unknown binary operator: "+b.operator);this.stateStack[0].value=this.createPrimitive(c)}else a.doneRight=!0,a.leftValue=a.value,this.stateStack.unshift({node:b.right});else a.doneLeft=!0,this.stateStack.unshift({node:b.left})};
+Interpreter.prototype.stepBlockStatement=function(){var a=this.stateStack[0],b=a.node,c=a.n_||0;b.body[c]?(a.done=!1,a.n_=c+1,this.stateStack.unshift({node:b.body[c]})):(a.done=!0,"Program"!=a.node.type&&this.stateStack.shift())};
+Interpreter.prototype.stepBreakStatement=function(){var a=this.stateStack.shift(),a=a.node,b=null;a.label&&(b=a.label.name);for(a=this.stateStack.shift();a&&"CallExpression"!=a.node.type&&"NewExpression"!=a.node.type;){if(b?b==a.label:a.isLoop||a.isSwitch)return;a=this.stateStack.shift()}throw SyntaxError("Illegal break statement");};
+Interpreter.prototype.stepCallExpression=function(){var a=this.stateStack[0],b=a.node;if(a.doneCallee_){if(!a.func_){if("function"==a.value.type)a.func_=a.value;else if(a.value.length&&(a.member_=a.value[0]),a.func_=this.getValue(a.value),!a.func_||"function"!=a.func_.type){this.throwException(this.TYPE_ERROR,(a.value&&a.value.type)+" is not a function");return}"NewExpression"==a.node.type?(a.funcThis_=this.createObject(a.func_),a.isConstructor_=!0):a.funcThis_=a.func_.boundThis_?a.func_.boundThis_:
+a.value.length?a.value[0]:this.stateStack[this.stateStack.length-1].thisExpression;a.arguments=a.func_.boundArgs_?a.func_.boundArgs_.concat():[];a.n_=0}if(!a.doneArgs_){0!=a.n_&&a.arguments.push(a.value);if(b.arguments[a.n_]){this.stateStack.unshift({node:b.arguments[a.n_]});a.n_++;return}a.doneArgs_=!0}if(a.doneExec_)this.stateStack.shift(),this.stateStack[0].value=a.isConstructor_&&"object"!==a.value.type?a.funcThis_:a.value;else if(a.doneExec_=!0,a.func_.node){for(var b=this.createScope(a.func_.node.body,
+a.func_.parentScope),c=0;cc?a.arguments[c]:this.UNDEFINED;this.setProperty(b,d,g)}d=this.createObject(this.ARRAY);for(c=0;c