scratchpad highlight and ctrl+r does weird replace




Developer Tools: Scratchpad
4 years ago
4 years ago


(Reporter: noitidart, Unassigned)


7 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [bugday-20140203][INVALID?])



4 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20131205075310

Steps to reproduce:

open scratchpad, type:

highilght the "hi" without quotes (do not higlight all though), press ctrl+r to run it, it replaces it, and we see this contents:

Exception: hi is not defined

if you highlight just the semicolon and hit ctrl+r, it clears select range but does nothing

Actual results:

replaced with error and didnt run

Expected results:

it should have run the code

Comment 1

4 years ago
Why should it work?  It tries to run the selection.
Component: Untriaged → Developer Tools: Scratchpad
OS: Windows XP → All
Whiteboard: [bugday-20140203][INVALID?]
This is intended behavior, although it might be worth having a discussion on how intuitive the behavior is.
Hardware: x86 → All
Version: 26 Branch → 7 Branch

Comment 3

4 years ago
oh no way thats super cool! i didnt know that!!!

Comment 4

4 years ago
ive been using scratchpad ever since it came, we should mention you can do this somewhere it is super cool!
Every time you open a Scratchpad there is this comment:

 * This is a JavaScript Scratchpad.
 * Enter some JavaScript, then Right Click or choose from the Execute Menu:
 * 1. Run to evaluate the selected text (Cmd-R),
 * 2. Inspect to bring up an Object Inspector on the result (Cmd-I), or,
 * 3. Display to insert the result in a comment after the selection. (Cmd-L)

Perhaps you missed the "evaluate the *selected* text" part (emphasis mine)?
Last Resolved: 4 years ago
Resolution: --- → INVALID

Comment 6

4 years ago
i dont understand that wording, especially on point 2 and 3.

i just typed alert('hi') in scratchpad and highlihgted it and did ctrl+i and then ctrl+l, it seemed to just run it and then it added text "undefiend" after

can you please explain that
alert returns undefined

Comment 8

4 years ago
ah ya thats right. ill play round with ctrl+i l r, learn them
You need to log in before you can comment on or make changes to this bug.