« first day (1490 days earlier)      last day (3463 days later) » 

11:08 PM
Howdy
 
Paddle.prototype = Object.create(Entity.prototype, {
    thickness: 20,
    draw: function () {
        ...........
This gives me an error
Uncaught TypeError: Property description must be an object: 20 pong.js:100(anonymous function) pong.js:100(anonymous function) pong.js:162
The line refers to thickness: 20
Since when do prototype properties must be objects?
 
They don't, your helpers are confusing things somehow.
let's see if I can bot...
!!> var Paddle = new function() { return this; }; Paddle.prototype.width = 20; new Paddle().width;
 
@ssube "TypeError: Paddle.prototype is undefined"
 
new function?
 
/me can bot, can't code
!!> var Paddle = function() { return this; }; Paddle.prototype.width = 20; new Paddle().width;
 
11:13 PM
@ssube 20
 
Right, but
 
Is Object.create doing something funny?
 
I believe the error is indicating the entire second argument isn't an object
 
!!> var Paddle = function() {}; Paddle.prototype = Object.create({}, {thickness: 20}); (new Paddle).thickness;
 
@SecondRikudo "TypeError: value is not a non-null object"
 
11:14 PM
can I see the rest of the code?
 
@rlemon I'm creating a repo as we speak.
 
!!> var Paddle = function() {}; Paddle.prototype = Object.create({}, {thickness: 20}); new Paddle().thickness;
 
@ssube "TypeError: value is not a non-null object"
 
it does need to be an object. doh m e
and it makes sense that it should be
 
11:16 PM
never seen an error saying it must be null
 
non-null object
meaning an object with something in it
 
@rlemon What? No it doesn't make sense...
 
Paddle.prototype = Object.create(Entity.prototype, {
    thickness: { writable: true, configurable: true, value: 20 },
    ....
sure it does, you need to describe the new property
 
OH, it's an options object for each one
 
@rlemon damn double negatives
 
11:18 PM
Do I need to do it for everything? functionns and all?
 
you know the properties you pass to Object.defineProperties ?
afaik, mirror image
 
Did not know that
TIL
 
Yes, you need an object describing the property for every property, but you don't need to add all the properties, writeable and configurable have default values etc, but you do need a value.
It's all explained on MDN
o = Object.create({}, { p: { value: 42 } });
 
This makes things a lot less nice looking :|
I think I'll go with the classic Paddle.prototype.whatever = function() style
 
Anyone familiarized with using SetTimeout or RequestAnimationFrame functions?
 
11:32 PM
maybe
 
yes
 
@rlemon and @copy has to do with this: jsfiddle.net/q20110f7/1
ive been stuck with it for weeks, will send more info by email and ill pay to fix if interested
 
Entity.constructor.call(this, centerPosition);
Y U ERROR?!
Uncaught SyntaxError: Unexpected identifier pong.js:87Paddle pong.js:87init pong.js:15(anonymous function) pong.js:157(anonymous function) pong.js:158
 
learn2readerrormessages
 
@SecondRikudo Possibly an unexpected identifier?
 
11:38 PM
@copy I read the error message
function Paddle(centerPosition, width, movingSpeed, moveLogic) {
    Entity.constructor.call(this, centerPosition);
    this.width = width;
    this.speed = movingSpeed;
    this.moveLogic = moveLogic;
}
This is the whole function
Do you see a problem?
 
It's a SyntaxError
 
This code passes lint dammit
 
Oh, that's actually weird then
JSON?
 
Looks fine, must be the arguments passed in ?
 
11:40 PM
Shouldn't, I haven't changed that since it last worked
But let me see in the debugger
 
Summarizing its an html table, in that table the user must select some cells, and after pushing a button a image from a cell must move to each cell and back to origin simulating building all the cells the user selected. The problem i have is it works fine with a single block, but it goes crazy when selecting more than one.
 
Doesn't seem to be anything wrong with the argument
 
What's Entity.constructor
 
More info by email if interested, will pay to fix.
 
11:42 PM
Also, it's a syntax error, it's a "compilation time" thing, whatever I passed shouldn't cause a syntax error
 
Oddly, one of the best things for finding/deleting unused code is code coverage tests.
 
function Entity(centerPosition) {
    this.position = centerPosition;
}
 
whats this
 
@copy - native constructor, returns function (itself) etc
 
11:43 PM
@SecondRikudo So it's Function
Which explains the syntax error
 
Yes
How so?
 
did you set the constructor?
 
@rlemon Even when I did, same error.
 
Entity.prototype.constructor = Entity;
 
And like I said, it did work earlier.
 
11:43 PM
@rlemon noice
 
@SecondRikudo It's Function, so you're doing Function.call(this, centerPosition);
 
Entity.prototype = {
    constructor: Entity,
    moveTo: function (newPosition) {
@copy ^
Even with this, still same error.
I'll try Entity.call though
 
Yeah, but Entity != Entity.prototype
 
function Foo() { console.log( 1 ); }
Foo.prototype.constructor = Foo;
var f = new Foo();
f.constructor.call();
> 1
> 1
 
sorry im late. is the fiddle supposed to do anything
 
11:48 PM
And what exactly is on line 87 etc ?
 
You're sure you didn't miss or add something somewhere else that makes the braces not match etc ?
 
@rlemon "And some people are more concerned about what the dude who operated this little object, was wearing." haha
FTR, he was wearing a hoodie
 
i love how you know
 
I was watching the ESA broadcast
 
11:54 PM
so @rlemon @adeneo would you please take a look by email and decide if interested or not?
dont have to answer today anyway
 
@user3470815 I took a look at it, but I don't know what I'm supposed to do with it
 
^ that, the fiddle doesn't do anything, if the Lemon isn't too busy drying corn, he'll fix it
 
If you would explain what's supposed to happen, that would be helpful
 
sorry, no interest.
good luck tho
 
Also, have you made sure to eliminate everything you can find that doesn't affect the problem?
 
11:56 PM
its a bastard machine
i think
 
that fiddle is the piece of code suspected of not working correctly, but i cant paste the whole code on fiddle because it uses a extenal js
ill send the full code by email
Summarizing its an html table, in that table the user must select some cells, and after pushing a button a image from a cell must move to each cell and back to origin simulating building all the cells the user selected. The problem i have is it works fine with a single block, but it goes crazy when selecting more than one.
 
what are arguments being passed in
 
Please create a small, self-contained, complete example. I don't have time to read code that doesn't have anything to do with the problem.
 

« first day (1490 days earlier)      last day (3463 days later) »