google / lovefield

Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.
https://google.github.io/lovefield/
Apache License 2.0
6.81k stars 366 forks source link

Broken in Safari since "Correct lf.structs.Set type signature." commit #62

Closed kenjitayama closed 9 years ago

kenjitayama commented 9 years ago

The Quick Start code isn't working in Mac Safari since the following commit https://github.com/google/lovefield/commit/b054565617bcb5c78608d5d496f5cc415d9f4784

how to confirm

git checkout b054565617bcb5c78608d5d496f5cc415d9f4784
cd demos/todo
ln -s ../../dist/lovefield.js
vi todo.html # change script tag to reference lovefield.js in current directory
gulp debug

The error is:

[Error] TypeError: undefined is not an object (evaluating 'childNode.visited')
    (anonymous function) (lovefield.js, line 11270)
    forEach ([native code], line 0)
    checkCycleUtil_ (lovefield.js, line 11268)
    (anonymous function) (lovefield.js, line 11292)
    forEach ([native code], line 0)
    checkFkCycle_ (lovefield.js, line 11291)
    finalize_ (lovefield.js, line 11265)
    getSchema (lovefield.js, line 11301)
    connect (lovefield.js, line 11313)
    global code (todo.html, line 26)

Mac Safari version 8.0.7 (10600.7.12)

arthurhsu commented 9 years ago

Safari seems to have a different opinion to JavaScript standards. It treats undefined as an explicit parameter.

new window.Set(undefined) < Set size: 1 proto: Set

new window.Set() < Set size: 0 proto: Set

We'll need to workaround this in lf.structs.set code.

kenjitayama commented 9 years ago

Wow.. I tried that for myself too. I know it's tough supporting Safari/Mobile Safari. Seen many other issues. Cheers for the hard work.

arthurhsu commented 9 years ago

Fixed a5ebe1dc3feefebfeeb687887a717b687385444b