Skip to content

Commit df69daf

Browse files
committed
Merge pull request #3 from thediamantaire/master
"IsUndefined()" replaced by "== js.Undefined", as in gopherjs/js/js.go
2 parents d0acc79 + c902ef8 commit df69daf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

jquery.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func (j JQuery) RemoveProp(property string) JQuery {
317317

318318
func (j JQuery) Attr(property string) string {
319319
attr := j.o.Call("attr", property)
320-
if attr.IsUndefined() {
320+
if attr == js.Undefined {
321321
return ""
322322
}
323323
return attr.Str()
@@ -546,7 +546,7 @@ func (j JQuery) SetData(key string, value interface{}) JQuery {
546546

547547
func (j JQuery) Data(key string) interface{} {
548548
result := j.o.Call("data", key)
549-
if result.IsUndefined() {
549+
if result == js.Undefined {
550550
return nil
551551
}
552552
return result.Interface()

test/test/index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ func main() {
494494
QUnit.Test("On,One,Off,Trigger", func(assert QUnit.QUnitAssert) {
495495

496496
fn := func(ev jquery.Event) {
497-
assert.Ok(!ev.Data.IsUndefined(), "on() with data, check passed data exists")
497+
assert.Ok(!ev.Data == js.Undefined, "on() with data, check passed data exists")
498498
assert.Equal(ev.Data.Get("foo"), "bar", "on() with data, Check value of passed data")
499499
}
500500

0 commit comments

Comments
 (0)