Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Uncaught RangeError: Invalid array length #6

Closed
gilje opened this issue Jun 16, 2017 · 3 comments · Fixed by #7
Closed

Uncaught RangeError: Invalid array length #6

gilje opened this issue Jun 16, 2017 · 3 comments · Fixed by #7

Comments

@gilje
Copy link

gilje commented Jun 16, 2017

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.19.0-beta0 x64
Electron: 1.6.9
OS: Unknown Windows version
Thrown From: atom-mdtoc package 0.8.3

Stack Trace

Uncaught RangeError: Invalid array length

At C:\Users\gilje\.atom\packages\atom-mdtoc\lib\toc-view.coffee:219

RangeError: Invalid array length
    at String.module.exports.String.repeat (/packages/atom-mdtoc/lib/toc-view.coffee:219:27)
    at LineNumberGutterComponent.render (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/text-editor-component.js:3007:43)
    at Object.updateSync (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/component-helpers.js:99:40)
    at LineNumberGutterComponent.update (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/text-editor-component.js:2973:18)
    at updateComponent (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:52:19)
    at patch (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:16:25)
    at updateChildren (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:18:15)
    at updateChildren (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:18:15)
    at Object.updateSync (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/component-helpers.js:108:26)
    at GutterContainerComponent.update (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/text-editor-component.js:2865:18)
    at updateComponent (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:52:19)
    at patch (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:16:25)
    at updateChildren (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:18:15)
    at updateChildren (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/patch.js:18:15)
    at Object.updateSync (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/node_modules/etch/lib/component-helpers.js:108:26)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/text-editor-component.js:357:16)
    at TextEditorComponent.updateSync (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/text-editor-component.js:259:16)
    at etch.getScheduler.updateDocument (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/text-editor-component.js:212:46)
    at ViewRegistry.module.exports.ViewRegistry.performDocumentUpdate (~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/view-registry.js:187:15)
    at ~/AppData/Local/atom/app-1.19.0-beta0/resources/app/src/view-registry.js:3:65

Commands

     -1:48.8.0 core:delete (input.hidden-input)
     -1:41.3.0 core:paste (input.hidden-input)
  2x -1:38 editor:outdent-selected-rows (input.hidden-input)
     -1:29.1.0 core:move-left (input.hidden-input)
     -1:20.9.0 editor:newline (input.hidden-input)
  4x -1:20.6.0 core:backspace (input.hidden-input)
     -1:19.4.0 editor:newline (input.hidden-input)
 10x -1:19.1.0 core:backspace (input.hidden-input)
     -1:14.3.0 editor:newline (input.hidden-input)
     -1:14.2.0 markdown:indent-list-item (input.hidden-input)
  2x -1:12.1.0 core:backspace (input.hidden-input)
  2x -1:08.3.0 editor:newline (input.hidden-input)
  2x -0:53.4.0 core:backspace (input.hidden-input)
  6x -0:46.7.0 editor:outdent-selected-rows (input.hidden-input)
  3x -0:17.9.0 editor:newline (input.hidden-input)
     -0:12.2.0 atom-mdtoc:insert (div.line.cursor-line)

Non-Core Packages

atom-beautify 0.29.26 
atom-clock 0.1.9 
atom-mdtoc 0.8.3 
chester-atom-syntax 0.2.0 
code-peek 1.4.20 
color-picker 2.2.5 
highlight-selected 0.13.1 
language-markdown 0.23.0 
markdown-preview-enhanced 0.13.0 
package-sync 1.1.0 
pigments 0.39.1 
pretty-json 1.6.3 
pubster-syntax 3.0.1 
seti-syntax 1.1.3 
seti-ui 1.8.0 
tool-bar-markdown-writer 0.3.0 
@airclear
Copy link
Contributor

airclear commented Aug 11, 2017

@mcpride @gilje

modify file toc-view.coffee

// replace 
String::repeat = (n) -> Array(n+1).join(this)
// to
String::_repeat_ = (n) -> Array(n+1).join(this)

//replace
@tocContent += ' '.repeat(level - 1)
//to
@tocContent += ' '._repeat_(level - 1)

//replace
@tocContent += '   '.repeat222(level - 1) + '- '
//to
@tocContent += '   '._repeat_(level - 1) + '- '

or use this plugin : https://github.com/airclear/atom-mdtoc-sef

@justinhartman
Copy link

This just happened to me. This has been open for 15 months... Is this ever going to be resolved? Is this package being maintained?

@justinhartman
Copy link

Sorry, scrap that last comment. Last commit was 3 years ago, clearly this won't be fixed.....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants