New issue
Advanced search Search tips

Issue 827292 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Code for PAC library function dateRange() is (seemingly) broken

Project Member Reported by eroman@chromium.org, Mar 29 2018

Issue description

According to the examples at https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file#dateRange():

    dateRange(24, "DEC")

Should "return true on 24th of December each year".

While this is technically true, that is not the interpretation from the de-facto legacy code inherited from Netscape (https://dxr.mozilla.org/mozilla-central/source/netwerk/base/ProxyAutoConfig.cpp#170), which will unconditionally return true in this case.

The code for dateRange is incomprehensible, as is its documentation, so it unclear to me what the meaning of this pattern is supposed to be.

Given how wacky the other PAC library functions are, this is probably just a case where the documentation on MDN needs updating and the functions remain unchanged, and we close this out as WontFix.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1af6b262b7af4dc88687410db09e662bf2395dda

commit 1af6b262b7af4dc88687410db09e662bf2395dda
Author: Eric Roman <eroman@chromium.org>
Date: Thu Mar 29 21:56:20 2018

Address a TODO in the testing of the PAC JavaScript library.

Reverses the expectation for some seemingly broken cases, and documents the oddity.

Bug: 827292
Change-Id: I2dc0c859a2a0d68a21b0d0aeec6a6a71f305553f
Reviewed-on: https://chromium-review.googlesource.com/986751
Reviewed-by: Helen Li <xunjieli@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546971}
[modify] https://crrev.com/1af6b262b7af4dc88687410db09e662bf2395dda/net/data/proxy_resolver_v8_unittest/pac_library_unittest.js

Project Member

Comment 2 by bugdroid1@chromium.org, Apr 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9513f52b377b2200c9f0bd8454265816ea0891b6

commit 9513f52b377b2200c9f0bd8454265816ea0891b6
Author: Eric Roman <eroman@chromium.org>
Date: Wed Apr 04 23:49:47 2018

Update the PAC JavaScript library to match latest Firefox code.

This brings it up to revision 6aa3b57955fed5e137d0306478e1a4b424a6d392, which includes the following two changes:

* Support for reversed dates in timeRange() and dateRange():
  https://hg.mozilla.org/mozilla-central/rev/cd913073f87c
* Additional validation of IP(v4) literals in isInNet:
  https://hg.mozilla.org/mozilla-central/rev/dd66d01e757c

Bug: 827292
Change-Id: I3d6670c7ceed0fc1bc453d6892922ffb047ab2bc
Reviewed-on: https://chromium-review.googlesource.com/986949
Commit-Queue: Eric Roman <eroman@chromium.org>
Reviewed-by: Helen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548253}
[modify] https://crrev.com/9513f52b377b2200c9f0bd8454265816ea0891b6/net/data/proxy_resolver_v8_unittest/pac_library_unittest.js
[modify] https://crrev.com/9513f52b377b2200c9f0bd8454265816ea0891b6/net/proxy_resolution/pac_js_library.h
[modify] https://crrev.com/9513f52b377b2200c9f0bd8454265816ea0891b6/net/proxy_resolution/proxy_resolver_v8_unittest.cc

Sign in to add a comment