Reviewers: Lasse Reichstein, Mads Ager, Message: Draft of object literal validation. Most of the checks are actually required even outside of strict mode. The code is based on object literal codegen but must run early for object literal errors are early errors.
Any feedback welcome. Thank you! Martin http://codereview.chromium.org/6335010/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6335010/diff/1/src/parser.cc#newcode3016 src/parser.cc:3016: bool IsEqualString(void* first, void* second); These 2 are defined in ast.cc, ideally I'd want to move them to some shared location. Is there a good place? This declaration feels suboptimal. http://codereview.chromium.org/6335010/diff/1/src/parser.cc#newcode3061 src/parser.cc:3061: void ObjectLiteralPropertyChecker::CheckProperty( Similar code exists in ast.cc and is executed when emitting object literal. This is too late because the object literal errors must be early errors. http://codereview.chromium.org/6335010/diff/1/src/parser.cc#newcode3108 src/parser.cc:3108: // Data property conflicting with an accessor. Most of these checks should execute even outside of strict mode. Only duplicate data properties are strict mode check. Description: Strict mode object literal validation (Draft) * Detect duplicate data properties in strict mode * Detect conflict between 2 accessors of same kind or accessor and data property. BUG= TEST=test/mjsunit/strict-mode.js Please review this at http://codereview.chromium.org/6335010/ SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge Affected files: M src/messages.js M src/parser.cc M test/mjsunit/strict-mode.js -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
