LoginSignup
244
238

More than 5 years have passed since last update.

Safari 9.0 の JS で「同じ関数を繰り返し実行しただけで返り値が変わる」という強烈なバグが発見されてる

Last updated at Posted at 2015-12-12

Webkit  Bugzilla 
 Qiita 

https://bugs.webkit.org/show_bug.cgi?id=151354 

 Google+  
URL 

 jsfiddle 
Safari  JavaScript 

 (2015.12.14)


 Bugzilla 

Yusuke SUZUKI 稿 ()

 http://trac.webkit.org/changeset/194021 


2015 1214 Webkit Nightly  r194029 

 r194029 
Safari 

実際の動作

オブジェクトのキー"1"に対応する値を取り出す超シンプルな関数
function getOne(a) { return a['1']; }

この関数に対して

getOne({1: true})

 true 
 getOne({2: true})  ( undefined ) 36
 getOne({1: true})  undefined 

  Mac OS X  Safari 36 getOne({2: true})  undefined 

実際の動作.png


 Safari  JavaScript 
 Google+  Google Tag Manager 


 Safari Version 9.0.2 
 El Capitan  Yosemite 

 iPhone 6S  Mobile Safari Version/9.0 
( iPhone 5S  Twitter )

Twitter Google Chrome/Chromium  Webkit  JavaScriptCore  V8  Chromium 
 Chromium  Blink 

2016-02-07 


OS X  Safari  Version 9.0.3 (11601.4.4) 

2017-04-09 


2016 

244
238
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
244
238